]> xenbits.xensource.com Git - xen.git/commitdiff
scripts: Fix git-checkout.sh to work with branches other than master
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 30 Oct 2024 19:03:42 +0000 (19:03 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 31 Oct 2024 10:34:13 +0000 (10:34 +0000)
Xen uses master for QEMU_UPSTREAM_REVISION, and has done for other trees too
in the path.  Apparently we've never specified a different branch, because the
git-clone rune only pulls in the master branch; it does not pull in diverging
branches.  Fix this by stating which branch/tag is wanted.

$TAG is really a committish, and git-clone's -b/--branch takes a committish
too.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
scripts/git-checkout.sh

index fd4425ac4ee8687e0e88bfc89c1dfd4f0cc342a9..3796cbfe39a7e739be86d6c7c19ccc7978e59018 100755 (executable)
@@ -14,7 +14,7 @@ set -e
 if test \! -d $DIR-remote; then
        rm -rf $DIR-remote $DIR-remote.tmp
        mkdir -p $DIR-remote.tmp; rmdir $DIR-remote.tmp
-       $GIT clone $TREE $DIR-remote.tmp
+       $GIT clone -b $TAG $TREE $DIR-remote.tmp
        if test "$TAG" ; then
                cd $DIR-remote.tmp
                $GIT branch -D dummy >/dev/null 2>&1 ||: