X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=t%2Fgit-cat-tree;h=3a12f4d1ecd83396ce7f47659e12cfe99aab4083;hb=ea0cb087050dc86bae886c0b2605b83aa819b7d3;hp=bbbfa6b43846d2f21362eb9a5941635849154768;hpb=c7139a3fae51633f0f290ebf73f0cf5e4864e547;p=bup.git 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 $?