X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=bup.git;a=blobdiff_plain;f=t%2Fgit-cat-tree;h=3a12f4d1ecd83396ce7f47659e12cfe99aab4083;hp=bbbfa6b43846d2f21362eb9a5941635849154768;hb=2e4e894f4544bc16cda9511b84155b3d5643d5a8;hpb=64022b137df32652ec100a283d6f2041ec2bfd12 diff --git a/t/git-cat-tree b/t/git-cat-tree index bbbfa6b..3a12f4d 100755 --- a/t/git-cat-tree +++ b/t/git-cat-tree @@ -6,7 +6,7 @@ set -o pipefail usage() { cat <&2 - exit 1 -fi +case $# in + 1) ;; + 3) + if test "$1" != --git-dir; then + usage 1>&2 + exit 1 + fi + export GIT_DIR="$2" + shift 2 + ;; + *) + usage 1>&2 + exit 1 + ;; +esac top="$1" type=$(git cat-file -t "$top") || exit $?