1818 path_to_repo
1919}
2020
21+ #[ allow( dead_code) ]
2122pub fn generate_path_to_bare_repo < S > ( repo_name : S ) -> PathBuf
2223where
2324 S : Into < String > ,
4748 repo
4849}
4950
51+ #[ allow( dead_code) ]
5052pub fn setup_git_bare_repo < S > ( repo_name : S ) -> Repository
5153where
5254 S : Into < String > ,
7274 fs:: remove_dir_all ( & path_to_repo) . ok ( ) ;
7375}
7476
77+ #[ allow( dead_code) ]
7578pub fn teardown_git_bare_repo < S > ( repo_name : S )
7679where
7780 S : Into < String > ,
@@ -99,11 +102,13 @@ pub fn checkout_branch(repo: &Repository, branch_name: &str) {
99102 . unwrap ( ) ;
100103}
101104
105+ #[ allow( dead_code) ]
102106pub fn branch_exists ( repo : & Repository , branch_name : & str ) -> bool {
103107 repo. revparse_single ( & ( "refs/heads/" . to_owned ( ) + branch_name) )
104108 . is_ok ( )
105109}
106110
111+ #[ allow( dead_code) ]
107112pub fn branch_equal ( repo : & Repository , branch_name : & str , other_branch : & str ) -> bool {
108113 let obj = repo
109114 . revparse_single ( & format ! ( "{}^{{commit}}" , branch_name) )
@@ -169,6 +174,7 @@ pub fn commit_all(repo: &Repository, message: &str) {
169174 create_commit ( repo, root_tree_oid, message) ;
170175}
171176
177+ #[ allow( dead_code) ]
172178pub fn delete_local_branch ( repo : & Repository , branch_name : & str ) {
173179 let mut some_branch = repo. find_branch ( branch_name, BranchType :: Local ) . unwrap ( ) ;
174180
@@ -178,6 +184,7 @@ pub fn delete_local_branch(repo: &Repository, branch_name: &str) {
178184 some_branch. delete ( ) . unwrap ( ) ;
179185}
180186
187+ #[ allow( dead_code) ]
181188pub fn get_current_branch_name ( repo : & Repository ) -> String {
182189 let head = repo. head ( ) . unwrap ( ) ;
183190 head. shorthand ( ) . unwrap ( ) . to_string ( )
@@ -194,9 +201,9 @@ pub fn create_new_file(path_to_repo: &Path, file_name: &str, file_contents: &str
194201 writeln ! ( file, "{}" , file_contents) . unwrap ( ) ;
195202}
196203
204+ #[ allow( dead_code) ]
197205pub fn append_file ( path_to_repo : & Path , file_name : & str , file_contents : & str ) {
198206 let mut file = OpenOptions :: new ( )
199- . write ( true )
200207 . append ( true )
201208 . open ( path_to_repo. join ( file_name) )
202209 . unwrap ( ) ;
@@ -222,6 +229,7 @@ where
222229 . expect ( "Failed to run git-chain" )
223230}
224231
232+ #[ allow( dead_code) ]
225233pub fn run_test_bin_expect_err < I , T , P : AsRef < Path > > ( current_dir : P , arguments : I ) -> Output
226234where
227235 I : IntoIterator < Item = T > ,
@@ -257,11 +265,13 @@ where
257265 output
258266}
259267
268+ #[ allow( dead_code) ]
260269pub fn display_outputs ( output : & Output ) {
261270 io:: stdout ( ) . write_all ( & output. stdout ) . unwrap ( ) ;
262271 io:: stderr ( ) . write_all ( & output. stderr ) . unwrap ( ) ;
263272}
264273
274+ #[ allow( dead_code) ]
265275pub fn run_git_command < I , T , P : AsRef < Path > > ( current_dir : P , arguments : I ) -> Output
266276where
267277 I : IntoIterator < Item = T > ,
@@ -281,6 +291,7 @@ where
281291 output
282292}
283293
294+ #[ allow( dead_code) ]
284295pub fn run_test_bin_for_rebase < I , T , P : AsRef < Path > > ( current_dir : P , arguments : I ) -> Output
285296where
286297 I : IntoIterator < Item = T > ,
0 commit comments