1#!/bin/sh
   2#
   3# Copyright (c) 2005 Johannes Schindelin
   4#
   5# Test that the current fetch-pack/upload-pack plays nicely with
   7# an old counterpart
   8cd $(dirname $0) || exit 1
  10: ${SHELL_PATH=/bin/sh}
  11tmp=`pwd`/.tmp$$
  13retval=0
  15if [ -z "$1" ]; then
  17        list="fetch upload"
  18else
  19        list="$@"
  20fi
  21for 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        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
  37                "$SHELL_PATH" "$tmp" || retval=$?
  39                rm -f "$tmp"
  40                test $retval != 0 && exit $retval
  42        else
  43                echo "Skipping test for $i, since I cannot find $pgm"
  44        fi
  45done
  46exit 0
  48