From: Richard Hartmann Date: Tue, 22 Dec 2015 20:47:53 +0000 (+0100) Subject: Merge branch 'fix/support_old_git' X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/6e5118a290be0dc24b919e8dc249aa9d763cd8b6?hp=4dde85340f627e187dad582610e881314404ab53 Merge branch 'fix/support_old_git' --- diff --git a/vcsh b/vcsh index 06f6c33..98e0acd 100755 --- a/vcsh +++ b/vcsh @@ -162,7 +162,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 [ 1 -lt "$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" ] &&