From: Richard Hartmann Date: Sun, 29 Nov 2015 20:40:41 +0000 (+0100) Subject: vcsh: Handle Git older than 2.x X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/b40cd1a7fe1c45bd1f7f7f80802b157a41f97dfe?hp=cf9bd27d5bcbecf461b55acd76dbf57679e4a6b3 vcsh: Handle Git older than 2.x We will fetch more data than needed with Git 1.8, but other than that... --- diff --git a/vcsh b/vcsh index c30b12d..d77f7cc 100755 --- a/vcsh +++ b/vcsh @@ -159,7 +159,12 @@ clone() { You should add files to your new repository." exit fi - git fetch origin "$VCSH_BRANCH" + GIT_VERSION_MAJOR=$(git --version | sed -n 's/.* \([0-9]\)\..*/\1/p' ) + if [ 2 -ge "$GIT_VERSION_MAJOR" ];then + git fetch origin "$VCSH_BRANCH" + else + git fetch origin + fi hook pre-merge git ls-tree -r --name-only origin/"$VCSH_BRANCH" | (while read object; do [ -e "$object" ] &&