t / t5501-old-fetch-and-upload.shon commit combine-diff: Honour -z option correctly. (6baf048)
   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
  10: ${SHELL_PATH=/bin/sh}
  11
  12tmp=`pwd`/.tmp$$
  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
  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
  37
  38                "$SHELL_PATH" "$tmp" || retval=$?
  39                rm -f "$tmp"
  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