File tree 1 file changed +13
-1
lines changed
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)
21
21
if ( ! Directory . Exists ( GitPath ) ) Directory . CreateDirectory ( GitPath ) ;
22
22
if ( ! File . Exists ( Path . Join ( GitPath , ".git" , "config" ) ) ) RunCommand ( $ "init") ;
23
23
24
- RunCommand ( $ "config remove-section remote.origin") ;
24
+ RunCommandIgnoreErrors ( $ "config remove-section remote.origin") ;
25
25
RunCommand ( $ "remote add origin --mirror=fetch { repository } ") ;
26
26
}
27
27
@@ -137,6 +137,18 @@ public void SetBranchRef(string branch, string reference)
137
137
RunCommand ( $ "branch -f { branch } { reference } ") ;
138
138
}
139
139
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
+
140
152
void RunCommand ( string arguments )
141
153
{
142
154
foreach ( var line in GetCommandOutput ( arguments , true ) )
You can’t perform that action at this time.
0 commit comments