@@ -89,28 +89,28 @@ private Checkout CloneOrUpdateRepository(Repository repository, string name, Con
89
89
{
90
90
_logger . LogInformation ( "Pull: {Name}\t {Repository}\t {RelativePath}" , name , repository , relativePath ) ;
91
91
// --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" ) ;
93
93
head = Capture ( checkoutFolder , "git" , "rev-parse" , "HEAD" ) ;
94
94
}
95
95
else
96
96
{
97
97
_logger . LogInformation ( "Checkout: {Name}\t {Repository}\t {RelativePath}" , name , repository , relativePath ) ;
98
98
if ( repository . CheckoutStrategy == "full" )
99
99
{
100
- Exec ( name , "git" , "clone" , repository . Origin , checkoutFolder . FullName ,
100
+ Exec ( "git" , "clone" , repository . Origin , checkoutFolder . FullName ,
101
101
"--depth" , "1" , "--single-branch" ,
102
102
"--branch" , repository . CurrentBranch
103
103
) ;
104
104
}
105
105
else if ( repository . CheckoutStrategy == "partial" )
106
106
{
107
- Exec ( name ,
107
+ Exec (
108
108
"git" , "clone" , "--filter=blob:none" , "--no-checkout" , repository . Origin , checkoutFolder . FullName
109
109
) ;
110
110
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" ) ;
114
114
head = Capture ( checkoutFolder , "git" , "rev-parse" , "HEAD" ) ;
115
115
}
116
116
}
@@ -125,17 +125,17 @@ private Checkout CloneOrUpdateRepository(Repository repository, string name, Con
125
125
} ;
126
126
}
127
127
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 ) ;
129
129
130
- private void ExecIn ( string name , IDirectoryInfo ? workingDirectory , string binary , params string [ ] args )
130
+ private void ExecIn ( IDirectoryInfo ? workingDirectory , string binary , params string [ ] args )
131
131
{
132
- var arguments = new StartArguments ( binary , args )
132
+ var arguments = new ExecArguments ( binary , args )
133
133
{
134
134
WorkingDirectory = workingDirectory ? . FullName
135
135
} ;
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 } ") ;
139
139
}
140
140
141
141
private string Capture ( IDirectoryInfo ? workingDirectory , string binary , params string [ ] args )
0 commit comments