1717import com .devonfw .tools .ide .log .IdeSubLogger ;
1818import com .devonfw .tools .ide .process .ProcessContext ;
1919import com .devonfw .tools .ide .process .ProcessErrorHandling ;
20+ import com .devonfw .tools .ide .process .ProcessMode ;
2021import com .devonfw .tools .ide .process .ProcessResult ;
2122
2223/**
@@ -96,7 +97,7 @@ public void pullOrClone(String gitRepoUrl, Path targetRepository) {
9697 initializeProcessContext (targetRepository );
9798 if (Files .isDirectory (targetRepository .resolve (".git" ))) {
9899 // checks for remotes
99- ProcessResult result = this .processContext .addArg ("remote" ).run (true , false );
100+ ProcessResult result = this .processContext .addArg ("remote" ).run (ProcessMode . DEFAULT_CAPTURE );
100101 List <String > remotes = result .getOut ();
101102 if (remotes .isEmpty ()) {
102103 String message = targetRepository
@@ -183,7 +184,7 @@ public void clone(GitUrl gitRepoUrl, Path targetRepository) {
183184 this .processContext .addArg ("-q" );
184185 }
185186 this .processContext .addArgs ("--recursive" , parsedUrl , "--config" , "core.autocrlf=false" , "." );
186- result = this .processContext .run (true , false );
187+ result = this .processContext .run (ProcessMode . DEFAULT_CAPTURE );
187188 if (!result .isSuccessful ()) {
188189 this .context .warning ("Git failed to clone {} into {}." , parsedUrl , targetRepository );
189190 }
@@ -198,7 +199,7 @@ public void pull(Path targetRepository) {
198199 initializeProcessContext (targetRepository );
199200 ProcessResult result ;
200201 // pull from remote
201- result = this .processContext .addArg ("--no-pager" ).addArg ("pull" ).run (true , false );
202+ result = this .processContext .addArg ("--no-pager" ).addArg ("pull" ).run (ProcessMode . DEFAULT_CAPTURE );
202203
203204 if (!result .isSuccessful ()) {
204205 Map <String , String > remoteAndBranchName = retrieveRemoteAndBranchName ();
@@ -211,7 +212,7 @@ public void pull(Path targetRepository) {
211212 private Map <String , String > retrieveRemoteAndBranchName () {
212213
213214 Map <String , String > remoteAndBranchName = new HashMap <>();
214- ProcessResult remoteResult = this .processContext .addArg ("branch" ).addArg ("-vv" ).run (true , false );
215+ ProcessResult remoteResult = this .processContext .addArg ("branch" ).addArg ("-vv" ).run (ProcessMode . DEFAULT_CAPTURE );
215216 List <String > remotes = remoteResult .getOut ();
216217 if (!remotes .isEmpty ()) {
217218 for (String remote : remotes ) {
@@ -242,14 +243,14 @@ public void reset(Path targetRepository, String remoteName, String branchName) {
242243 initializeProcessContext (targetRepository );
243244 ProcessResult result ;
244245 // check for changed files
245- result = this .processContext .addArg ("diff-index" ).addArg ("--quiet" ).addArg ("HEAD" ).run (true , false );
246+ result = this .processContext .addArg ("diff-index" ).addArg ("--quiet" ).addArg ("HEAD" ).run (ProcessMode . DEFAULT_CAPTURE );
246247
247248 if (!result .isSuccessful ()) {
248249 // reset to origin/master
249250 context .warning ("Git has detected modified files -- attempting to reset {} to '{}/{}'." , targetRepository ,
250251 remoteName , branchName );
251- result = this .processContext .addArg ("reset" ).addArg ("--hard" ).addArg (remoteName + "/" + branchName ). run ( true ,
252- false );
252+ result = this .processContext .addArg ("reset" ).addArg ("--hard" ).addArg (remoteName + "/" + branchName )
253+ . run ( ProcessMode . DEFAULT_CAPTURE );
253254
254255 if (!result .isSuccessful ()) {
255256 context .warning ("Git failed to reset {} to '{}/{}'." , remoteName , branchName , targetRepository );
@@ -265,12 +266,12 @@ public void cleanup(Path targetRepository) {
265266 ProcessResult result ;
266267 // check for untracked files
267268 result = this .processContext .addArg ("ls-files" ).addArg ("--other" ).addArg ("--directory" ).addArg ("--exclude-standard" )
268- .run (true , false );
269+ .run (ProcessMode . DEFAULT_CAPTURE );
269270
270271 if (!result .getOut ().isEmpty ()) {
271272 // delete untracked files
272273 context .warning ("Git detected untracked files in {} and is attempting a cleanup." , targetRepository );
273- result = this .processContext .addArg ("clean" ).addArg ("-df" ).run (true , false );
274+ result = this .processContext .addArg ("clean" ).addArg ("-df" ).run (ProcessMode . DEFAULT_CAPTURE );
274275
275276 if (!result .isSuccessful ()) {
276277 context .warning ("Git failed to clean the repository {}." , targetRepository );
0 commit comments