mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Do not fetch saltstack repo if shallow-cloning from a non-saltstack repo
This commit is contained in:
parent
2e2dae3f0f
commit
1dc003e4dd
1 changed files with 8 additions and 10 deletions
|
@ -1322,18 +1322,16 @@ __git_clone_and_checkout() {
|
|||
if [ "$__SHALLOW_CLONE" -eq "${BS_FALSE}" ]; then
|
||||
git clone "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME" || return 1
|
||||
cd "${__SALT_GIT_CHECKOUT_DIR}"
|
||||
fi
|
||||
|
||||
if [ "$(echo "$_SALT_REPO_URL" | grep -c -e '\(\(git\|https\)://github\.com/\|git@github\.com:\)saltstack/salt\.git')" -eq 0 ]; then
|
||||
# We need to add the saltstack repository as a remote and fetch tags for proper versioning
|
||||
echoinfo "Adding SaltStack's Salt repository as a remote"
|
||||
git remote add upstream "$_SALTSTACK_REPO_URL" || return 1
|
||||
echodebug "Fetching upstream(SaltStack's Salt repository) git tags"
|
||||
git fetch --tags upstream || return 1
|
||||
GIT_REV="origin/$GIT_REV"
|
||||
fi
|
||||
if [ "$(echo "$_SALT_REPO_URL" | grep -c -e '\(\(git\|https\)://github\.com/\|git@github\.com:\)saltstack/salt\.git')" -eq 0 ]; then
|
||||
# We need to add the saltstack repository as a remote and fetch tags for proper versioning
|
||||
echoinfo "Adding SaltStack's Salt repository as a remote"
|
||||
git remote add upstream "$_SALTSTACK_REPO_URL" || return 1
|
||||
echodebug "Fetching upstream(SaltStack's Salt repository) git tags"
|
||||
git fetch --tags upstream || return 1
|
||||
GIT_REV="origin/$GIT_REV"
|
||||
fi
|
||||
|
||||
if [ "$__SHALLOW_CLONE" -eq "${BS_FALSE}" ]; then
|
||||
echodebug "Checking out $GIT_REV"
|
||||
git checkout "$GIT_REV" || return 1
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue