From: Petr Baudis Date: Sun, 3 Aug 2008 01:27:01 +0000 (+0200) Subject: tg.sh: branch_contains(): Using -z instead of wc is faster in the common case X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;ds=sidebyside;h=1cccede543ce4a1d7aac51042e4b9b2e975453c5;p=topgit.git tg.sh: branch_contains(): Using -z instead of wc is faster in the common case --- diff --git a/tg.sh b/tg.sh index ae3dcda..54b7875 100644 --- a/tg.sh +++ b/tg.sh @@ -76,7 +76,7 @@ measure_branch() # Whether B1 is a superset of B2. branch_contains() { - [ "$(git rev-list ^"$1" "$2" | wc -l)" -eq 0 ] + [ -z "$(git rev-list ^"$1" "$2")" ] } # needs_update NAME [BRANCHPATH...]