phase1: forcibly checkout branch
authorJo-Philipp Wich <jo@mein.io>
Tue, 16 Jul 2019 17:14:08 +0000 (19:14 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 16 Jul 2019 17:14:08 +0000 (19:14 +0200)
Pass the -f flag to git checkout in order to ensure that any potentially
existing local changes are overwritten.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
phase1/master.cfg

index ff2f3e23b39fc1b790e06af2e694d7ec61090fae..cd951e06c5f6a2be7dfae35360f0fa6dacb3999b 100644 (file)
@@ -579,7 +579,7 @@ for target in targets:
        factory.addStep(ShellCommand(
                name = "gitcheckout",
                description = "Ensure that Git HEAD is sane",
-               command = "if [ -d .git ]; then git checkout %s; git branch --set-upstream-to origin/%s; else exit 0; fi" %(repo_branch, repo_branch),
+               command = "if [ -d .git ]; then git checkout -f %s; git branch --set-upstream-to origin/%s; else exit 0; fi" %(repo_branch, repo_branch),
                haltOnFailure = True))
 
        # check out the source