Support for pickaxe matching regular expressions
[tgit.git] / t / t5501-old-fetch-and-upload.sh
blob596c88b1c2f28e91a247309d383c56f3d670fe92
1 #!/bin/sh
3 # Copyright (c) 2005 Johannes Schindelin
6 # Test that the current fetch-pack/upload-pack plays nicely with
7 # an old counterpart
9 cd $(dirname $0) || exit 1
10 : ${SHELL_PATH=/bin/sh}
12 tmp=`pwd`/.tmp$$
14 retval=0
16 if [ -z "$1" ]; then
17 list="fetch upload"
18 else
19 list="$@"
22 for i in $list; do
23 case "$i" in
24 fetch) pgm="old-git-fetch-pack"; replace="$pgm";;
25 upload) pgm="old-git-upload-pack"; replace="git-fetch-pack --exec=$pgm";;
26 both) pgm="old-git-upload-pack"; replace="old-git-fetch-pack --exec=$pgm";;
27 esac
29 if where=`LANG=C LC_ALL=C which "$pgm" 2>/dev/null` &&
30 case "$where" in
31 "no "*) (exit 1) ;;
32 esac
33 then
34 echo "Testing with $pgm"
35 sed -e "s/git-fetch-pack/$replace/g" \
36 -e "s/# old fails/warn/" < t5500-fetch-pack.sh > $tmp
38 "$SHELL_PATH" "$tmp" || retval=$?
39 rm -f "$tmp"
41 test $retval != 0 && exit $retval
42 else
43 echo "Skipping test for $i, since I cannot find $pgm"
45 done
47 exit 0