Fix git invocation fail when man command is not available

This commit is contained in:
Denys Havrysh 2015-12-22 16:40:29 +02:00 committed by Denys Havrysh
parent 009d7c7728
commit 79789642a9

View file

@ -1291,7 +1291,7 @@ __git_clone_and_checkout() {
# Let's try shallow cloning to speed up.
# Test for "--single-branch" option introduced in git 1.7.10, the minimal version of git where the shallow
# cloning we need actually works
if [ "$(git clone --help | grep 'single-branch')" != "" ]; then
if [ "$(git clone 2>&1 | grep 'single-branch')" != "" ]; then
# The "--single-branch" option is supported, attempt shallow cloning
echoinfo "Attempting to shallow clone $GIT_REV from Salt's repository ${_SALT_REPO_URL}"
git clone --depth 1 --branch "$GIT_REV" "$_SALT_REPO_URL" "$__SALT_CHECKOUT_REPONAME"