@@ -89,28 +89,28 @@ private Checkout CloneOrUpdateRepository(Repository repository, string name, Con
8989 {
9090 _logger . LogInformation ( "Pull: {Name}\t {Repository}\t {RelativePath}" , name , repository , relativePath ) ;
9191 // --allow-unrelated-histories due to shallow clones not finding a common ancestor
92- ExecIn ( name , checkoutFolder , "git" , "pull" , "--depth" , "1" , "--allow-unrelated-histories" , "--no-ff" ) ;
92+ ExecIn ( checkoutFolder , "git" , "pull" , "--depth" , "1" , "--allow-unrelated-histories" , "--no-ff" ) ;
9393 head = Capture ( checkoutFolder , "git" , "rev-parse" , "HEAD" ) ;
9494 }
9595 else
9696 {
9797 _logger . LogInformation ( "Checkout: {Name}\t {Repository}\t {RelativePath}" , name , repository , relativePath ) ;
9898 if ( repository . CheckoutStrategy == "full" )
9999 {
100- Exec ( name , "git" , "clone" , repository . Origin , checkoutFolder . FullName ,
100+ Exec ( "git" , "clone" , repository . Origin , checkoutFolder . FullName ,
101101 "--depth" , "1" , "--single-branch" ,
102102 "--branch" , repository . CurrentBranch
103103 ) ;
104104 }
105105 else if ( repository . CheckoutStrategy == "partial" )
106106 {
107- Exec ( name ,
107+ Exec (
108108 "git" , "clone" , "--filter=blob:none" , "--no-checkout" , repository . Origin , checkoutFolder . FullName
109109 ) ;
110110
111- ExecIn ( name , checkoutFolder , "git" , "sparse-checkout" , "set" , "--cone" ) ;
112- ExecIn ( name , checkoutFolder , "git" , "checkout" , repository . CurrentBranch ) ;
113- ExecIn ( name , checkoutFolder , "git" , "sparse-checkout" , "set" , "docs" ) ;
111+ ExecIn ( checkoutFolder , "git" , "sparse-checkout" , "set" , "--cone" ) ;
112+ ExecIn ( checkoutFolder , "git" , "checkout" , repository . CurrentBranch ) ;
113+ ExecIn ( checkoutFolder , "git" , "sparse-checkout" , "set" , "docs" ) ;
114114 head = Capture ( checkoutFolder , "git" , "rev-parse" , "HEAD" ) ;
115115 }
116116 }
@@ -125,17 +125,17 @@ private Checkout CloneOrUpdateRepository(Repository repository, string name, Con
125125 } ;
126126 }
127127
128- private void Exec ( string name , string binary , params string [ ] args ) => ExecIn ( name , null , binary , args ) ;
128+ private void Exec ( string binary , params string [ ] args ) => ExecIn ( null , binary , args ) ;
129129
130- private void ExecIn ( string name , IDirectoryInfo ? workingDirectory , string binary , params string [ ] args )
130+ private void ExecIn ( IDirectoryInfo ? workingDirectory , string binary , params string [ ] args )
131131 {
132- var arguments = new StartArguments ( binary , args )
132+ var arguments = new ExecArguments ( binary , args )
133133 {
134134 WorkingDirectory = workingDirectory ? . FullName
135135 } ;
136- var result = Proc . StartRedirected ( arguments , new ConsoleLineHandler ( _logger , name ) ) ;
137- if ( result . ExitCode != 0 )
138- context . Collector . EmitError ( "" , $ "Exit code: { result . ExitCode } while executing { binary } { string . Join ( " " , args ) } in { workingDirectory } ") ;
136+ var result = Proc . Exec ( arguments ) ;
137+ if ( result != 0 )
138+ context . Collector . EmitError ( "" , $ "Exit code: { result } while executing { binary } { string . Join ( " " , args ) } in { workingDirectory } ") ;
139139 }
140140
141141 private string Capture ( IDirectoryInfo ? workingDirectory , string binary , params string [ ] args )
0 commit comments