File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public void Init(string repository)
2121 if ( ! Directory . Exists ( GitPath ) ) Directory . CreateDirectory ( GitPath ) ;
2222 if ( ! File . Exists ( Path . Join ( GitPath , ".git" , "config" ) ) ) RunCommand ( $ "init") ;
2323
24- RunCommand ( $ "config remove-section remote.origin") ;
24+ RunCommandIgnoreErrors ( $ "config remove-section remote.origin") ;
2525 RunCommand ( $ "remote add origin --mirror=fetch { repository } ") ;
2626 }
2727
@@ -137,6 +137,18 @@ public void SetBranchRef(string branch, string reference)
137137 RunCommand ( $ "branch -f { branch } { reference } ") ;
138138 }
139139
140+ void RunCommandIgnoreErrors ( string arguments )
141+ {
142+ try
143+ {
144+ RunCommand ( arguments ) ;
145+ }
146+ catch ( ApplicationException )
147+ {
148+ // We are deliberately ignoring errors; RunCommand will have already printed them
149+ }
150+ }
151+
140152 void RunCommand ( string arguments )
141153 {
142154 foreach ( var line in GetCommandOutput ( arguments , true ) )
You can’t perform that action at this time.
0 commit comments