File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import (
17
17
"path"
18
18
"path/filepath"
19
19
"runtime"
20
+ "strconv"
20
21
"time"
21
22
22
23
"code.gitea.io/gitea/modules/markup/external"
@@ -162,6 +163,12 @@ func main() {
162
163
return
163
164
}
164
165
166
+ // To force checkout (e.g. Windows complains about unclean work tree) set env variable FORCE=true
167
+ force , err := strconv .ParseBool (os .Getenv ("FORCE" ))
168
+ if err != nil {
169
+ force = false
170
+ }
171
+
165
172
//Otherwise checkout PR
166
173
if len (os .Args ) != 2 {
167
174
log .Fatal ("Need only one arg: the PR number" )
@@ -221,7 +228,7 @@ func main() {
221
228
log .Printf ("Checkout PR #%s in %s\n " , pr , branch )
222
229
err = tree .Checkout (& git.CheckoutOptions {
223
230
Branch : branchRef ,
224
- // Force: runtime.GOOS == "windows" ,
231
+ Force : force ,
225
232
})
226
233
if err != nil {
227
234
log .Fatalf ("Failed to checkout %s : %v" , branch , err )
You can’t perform that action at this time.
0 commit comments