File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ public void ResetHard()
4949 RunCommand ( "reset --hard" ) ;
5050 }
5151
52+ public void Clean ( )
53+ {
54+ RunCommand ( "clean --force -d -x" ) ;
55+ }
56+
5257 public void Merge ( string reference )
5358 {
5459 RunCommand ( $ "merge --no-edit --no-ff { reference } ") ;
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ static async Task AsyncMain(IConfigurationRoot config)
8686 git . Init ( $ "https://github.com/{ gitHubConfig [ "organization" ] } /{ gitHubConfig [ "repository" ] } .git") ;
8787 git . Fetch ( ) ;
8888 git . ResetHard ( ) ;
89+ git . Clean ( ) ;
8990 var baseBranchCommit = git . ParseRef ( gitHubConfig [ "baseBranch" ] ) ;
9091 var mergeBranchCommit = git . ParseRef ( gitHubConfig [ "mergeBranch" ] ) ;
9192 var mergeBranchTree = git . ParseRef ( $ "{ mergeBranchCommit } ^{{tree}}") ;
@@ -110,6 +111,7 @@ static async Task AsyncMain(IConfigurationRoot config)
110111 {
111112 autoMergePullRequestsFailure . Add ( pullRequest ) ;
112113 git . ResetHard ( ) ;
114+ git . Clean ( ) ;
113115 Console . WriteLine ( $ "Error: { error . Message } ") ;
114116 }
115117 }
You can’t perform that action at this time.
0 commit comments