]> git.corax.cc Git - foundry/commitdiff
buildbot: Check out the target branch in a separate statement
authorMatthias Kruk <m@m10k.eu>
Tue, 30 Nov 2021 10:44:09 +0000 (19:44 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 30 Nov 2021 10:44:09 +0000 (19:44 +0900)
Buildbot fails to perform any builds because it attempts to check out
a ref (referencing a commit) using git clone's `-b' switch, which only
accepts branch references.
This commit modifies buildbot to check out the ref in a separate call
to `git checkout', which allows commit refs to be checked out.

buildbot.sh

index 26f6836370303e3f1824d8fdcad9881f4a15e7bb..3e80cecd16f7838e9690bde4344bed8394a472da 100755 (executable)
@@ -27,7 +27,8 @@ build() {
 
        err=0
 
-       if ! output=$(git clone "$repository" -b "$branch" "$builddir/sources" 2>&1); then
+       if ! output=$(git clone "$repository" "$builddir/sources" 2>&1) ||
+          ! output+=$(cd "$builddir/sources" 2>&1 && git checkout "$branch" 2>&1); then
                err=1
        fi