From b40cd1a7fe1c45bd1f7f7f80802b157a41f97dfe Mon Sep 17 00:00:00 2001
From: Richard Hartmann <richih@debian.org>
Date: Sun, 29 Nov 2015 21:40:41 +0100
Subject: [PATCH] vcsh: Handle Git older than 2.x

We will fetch more data than needed with Git 1.8, but other than that...
---
 vcsh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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" ] &&
-- 
GitLab