X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=tg.sh;h=0804f733018773b89ab7890442ecd3c38ba7bef0;hb=be4a4967321b272d59bd0c87e73deeba365349db;hp=3af2cd8bbbfa78b0f7826192cffab929b4b54586;hpb=ad4ba21f04e5c36b258450a886a104351bcef8da;p=topgit.git diff --git a/tg.sh b/tg.sh index 3af2cd8..0804f73 100644 --- a/tg.sh +++ b/tg.sh @@ -226,7 +226,7 @@ needs_update() # branch_empty NAME branch_empty() { - [ -z "$(git diff-tree "refs/top-bases/$1" "$1" | fgrep -v " .top")" ] + [ -z "$(git diff-tree "refs/top-bases/$1" "$1" -- | fgrep -v " .top")" ] } # switch_to_base NAME [SEED] @@ -340,8 +340,9 @@ setup_hook "pre-commit" ## Dispatch # We were sourced from another script for our utility functions; -# this is set by hooks. -[ -z "$tg__include" ] || return 0 +# this is set by hooks. Skip the rest of the file. A simple return doesn't +# work as expected in every shell. See http://bugs.debian.org/516188 +if [ -z "$tg__include" ]; then if [ "$1" = "-r" ]; then shift @@ -374,4 +375,6 @@ help|--help|-h) . "@cmddir@"/tg-$cmd;; esac +fi + # vim:noet