X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=tg.sh;h=8264a3b074f1d6bbded09e8110f1c07be475ffdd;hb=294846dad135e8258f037b6695fb9c0cacc77e8e;hp=3718702e5cd20eb0aefcfbb36a77801411c88978;hpb=7aeb4b93b0179788006c17dd59fe5b971c6ad037;p=topgit.git diff --git a/tg.sh b/tg.sh index 3718702..8264a3b 100644 --- a/tg.sh +++ b/tg.sh @@ -25,17 +25,15 @@ cat_file() arg="$1" case "$arg" in '(w):'*) - arg=$(echo "$arg" | tail --bytes=+5) - cat "$arg" - return + cat "${arg#(w):}" ;; '(i):'*) # ':file' means cat from index - arg=$(echo "$arg" | tail --bytes=+5) - git cat-file blob ":$arg" + git cat-file blob "${arg#(i)}" ;; *) git cat-file blob "$arg" + ;; esac }