@@ -40,13 +40,12 @@ pub fn mirror_repo(mirror_dir: String, origin: &str, destination: &str) -> Resul
4040
4141 // Group common setting for al git commands in this closure
4242 let git_base_cmd = || {
43- let mut git = Command :: new ( "git" ) ;
43+ let mut git = Command :: new ( "/usr/bin/ git" ) ;
4444 if !log_enabled ! ( Info ) {
4545 git. stdout ( Stdio :: null ( ) ) ;
4646 }
4747 debug ! ( "Level {:?}" , log_enabled!( Info ) ) ;
48- git. current_dir ( & origin_dir)
49- . env ( "GIT_TERMINAL_PROMPT" , "0" ) ;
48+ git. env ( "GIT_TERMINAL_PROMPT" , "0" ) ;
5049 return git;
5150 } ;
5251
@@ -68,6 +67,7 @@ pub fn mirror_repo(mirror_dir: String, origin: &str, destination: &str) -> Resul
6867
6968 let mut set_url_cmd = git_base_cmd ( ) ;
7069 set_url_cmd
70+ . current_dir ( & origin_dir)
7171 . args ( & [ "remote" , "set-url" , "origin" ] )
7272 . arg ( origin) ;
7373
@@ -88,7 +88,7 @@ pub fn mirror_repo(mirror_dir: String, origin: &str, destination: &str) -> Resul
8888 }
8989
9090 let mut remote_update_cmd = git_base_cmd ( ) ;
91- remote_update_cmd. args ( & [ "remote" , "update" ] ) ;
91+ remote_update_cmd. current_dir ( & origin_dir ) . args ( & [ "remote" , "update" ] ) ;
9292
9393 trace ! ( "Remote update command started: {:?}" , remote_update_cmd) ;
9494
@@ -139,7 +139,7 @@ pub fn mirror_repo(mirror_dir: String, origin: &str, destination: &str) -> Resul
139139 info ! ( "Push to destination {}" , destination) ;
140140
141141 let mut push_cmd = git_base_cmd ( ) ;
142- push_cmd. args ( & [ "push" , "--mirror" ] ) . arg ( destination) ;
142+ push_cmd. current_dir ( & origin_dir ) . args ( & [ "push" , "--mirror" ] ) . arg ( destination) ;
143143
144144 trace ! ( "Push started: {:?}" , push_cmd) ;
145145
0 commit comments