fix git checkout from wrong working directory when other than master branch used

This commit is contained in:
ronivay
2021-08-18 10:08:01 +03:00
parent ce4c2d36e0
commit 2d7d197878
2 changed files with 4 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ CONFIGUPDATE=true
# Location of Xen Orchestra repository where source code is fetched
REPOSITORY="https://github.com/vatesfr/xen-orchestra"
# Git branch or tag (append tags/ before the tag name) where xen-orchestra sources are fetched.
# Git branch, tag (append tags/ before the tag name) or individual commit where xen-orchestra sources are fetched.
# Also, you can set this to "release" to use the latest tagged branch.
BRANCH="master"

View File

@@ -490,15 +490,14 @@ function InstallXO {
echo
printinfo "Checking out latest tagged release '$TAG'"
runcmd "git checkout $TAG"
runcmd "cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && git checkout $TAG"
runcmd "cd $(dirname "$0")"
# we don't need to do much magic if specific branch set so just checkout
elif [[ "$BRANCH" != "master" ]]; then
echo
printinfo "Checking out source code from branch '$BRANCH'"
printinfo "Checking out source code from branch/commit '$BRANCH'"
runcmd "cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME"
runcmd "git checkout $BRANCH"
runcmd "cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && git checkout $BRANCH"
runcmd "cd $(dirname "$0")"
fi