]> git.ipfire.org Git - thirdparty/git.git/blame - t/t5501-old-fetch-and-upload.sh
get_sha1_basic(): corner case ambiguity fix
[thirdparty/git.git] / t / t5501-old-fetch-and-upload.sh
CommitLineData
eebda31d
JS
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
9cd $(dirname $0) || exit 1
8d691951 10: ${SHELL_PATH=/bin/sh}
eebda31d 11
8d691951 12tmp=`pwd`/.tmp$$
eebda31d
JS
13
14retval=0
15
16if [ -z "$1" ]; then
17 list="fetch upload"
18else
19 list="$@"
20fi
21
22for 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
28
8d691951
JH
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
eebda31d
JS
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
37
8d691951
JH
38 "$SHELL_PATH" "$tmp" || retval=$?
39 rm -f "$tmp"
eebda31d
JS
40
41 test $retval != 0 && exit $retval
42 else
43 echo "Skipping test for $i, since I cannot find $pgm"
44 fi
45done
46
47exit 0
48