Implement an interoperability test for fetch-pack/upload-pack
The next patches will extend the pack protocol. This test assures that this extension is compatible to earlier versions of git-fetch-pack/git-upload-pack. All you need to do to take advantage of this test, is to install older known-to-be-working binaries in the path as "old-git-fetch-pack" and "old-git-upload-pack". Note that the warning when testing with old-git-fetch-pack is to be expected (it just says that the old version was not taking advantage of all the information which the server sent). Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin committed
Oct 28, 2005 at 04:48 UTC
eebda31d21d5d5df351b41994df875918863294e
1 file changed
+43
t/t5501-old-fetch-and-upload.sh
new
+43
@@ -0,0 +1,43 @@
1
+#!/bin/sh
2
+#
3
+# Copyright (c) 2005 Johannes Schindelin
4
+#
5
+
6
+# Test that the current fetch-pack/upload-pack plays nicely with
7
+# an old counterpart
8
+
9
+cd $(dirname $0) || exit 1
10
+
11
+tmp=$(mktemp tmp-XXXX)
12
+
13
+retval=0
14
+
15
+if [ -z "$1" ]; then
16
+ list="fetch upload"
17
+else
18
+ list="$@"
19
+fi
20
+
21
+for i in $list; do
22
+ case "$i" in
23
+ fetch) pgm="old-git-fetch-pack"; replace="$pgm";;
24
+ upload) pgm="old-git-upload-pack"; replace="git-fetch-pack --exec=$pgm";;
25
+ both) pgm="old-git-upload-pack"; replace="old-git-fetch-pack --exec=$pgm";;
26
+ esac
27
+
28
+ if which $pgm; then
29
+ echo "Testing with $pgm"
30
+ sed -e "s/git-fetch-pack/$replace/g" \
31
+ -e "s/# old fails/warn/" < t5500-fetch-pack.sh > $tmp
32
+
33
+ sh $tmp || retval=$?
34
+ rm $tmp
35
+
36
+ test $retval != 0 && exit $retval
37
+ else
38
+ echo "Skipping test for $i, since I cannot find $pgm"
39
+ fi
40
+done
41
+
42
+exit 0
43
+