chiark
/
gitweb
/
~ian
/
topgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed26ca8
)
tg.sh: branch_contains(): Using -z instead of wc is faster in the common case
author
Petr Baudis
<pasky@suse.cz>
Sun, 3 Aug 2008 01:27:01 +0000
(
03:27
+0200)
committer
Petr Baudis
<pasky@suse.cz>
Sun, 3 Aug 2008 01:27:01 +0000
(
03:27
+0200)
tg.sh
patch
|
blob
|
history
diff --git
a/tg.sh
b/tg.sh
index ae3dcda6446709183cf2f1032777f41655149a57..54b7875a39673886ef3abde6908922d512f0873f 100644
(file)
--- 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...]