From 1cccede543ce4a1d7aac51042e4b9b2e975453c5 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 3 Aug 2008 03:27:01 +0200 Subject: [PATCH] tg.sh: branch_contains(): Using -z instead of wc is faster in the common case --- tg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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...] -- 2.30.2