mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Properly refresh branches.
Just calling `git reset --hard` on a branch name doesn't pull in upstream changes.
This commit is contained in:
parent
60ad2dc9af
commit
6897ae92d5
1 changed files with 11 additions and 1 deletions
|
@ -730,7 +730,17 @@ __git_clone_and_checkout() {
|
|||
if [ -d $SALT_GIT_CHECKOUT_DIR ]; then
|
||||
cd $SALT_GIT_CHECKOUT_DIR
|
||||
git fetch
|
||||
git reset --hard $GIT_REV
|
||||
git checkout $GIT_REV
|
||||
|
||||
# Just calling `git reset --hard $GIT_REV` on a branch name that has
|
||||
# already been checked out will not update that branch to the upstream
|
||||
# HEAD; instead it will simply reset to itself. Check the ref to see
|
||||
# if it is a branch name, check out the branch, and pull in the
|
||||
# changes.
|
||||
git branch -a | grep -q ${GIT_REV}
|
||||
if [ "$?" == "0" ]; then
|
||||
git pull --rebase
|
||||
fi;
|
||||
else
|
||||
git clone https://github.com/saltstack/salt.git salt
|
||||
cd $SALT_GIT_CHECKOUT_DIR
|
||||
|
|
Loading…
Add table
Reference in a new issue