t / t5501-old-fetch-and-upload.shon commit Fix bunch of fd leaks in http-fetch (313c471)
   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
  11tmp=$(mktemp /tmp/tmp-XXXXXXXX)
  12
  13retval=0
  14
  15if [ -z "$1" ]; then
  16        list="fetch upload"
  17else
  18        list="$@"
  19fi
  20
  21for 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 2>/dev/null; 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
  40done
  41
  42exit 0
  43