summaryrefslogtreecommitdiff
path: root/t/t1512-rev-parse-disambiguation.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-03 21:21:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-09 23:42:23 (GMT)
commit957d74062c1f0e92368aeda335e27d2d61f584f6 (patch)
tree7b5c5c54cfe2d06d741ec8fcd103f1a8eeddcb38 /t/t1512-rev-parse-disambiguation.sh
parentc036c4c5e426cc7ee8070038607edf06ef1d661e (diff)
downloadgit-957d74062c1f0e92368aeda335e27d2d61f584f6.zip
git-957d74062c1f0e92368aeda335e27d2d61f584f6.tar.gz
git-957d74062c1f0e92368aeda335e27d2d61f584f6.tar.bz2
rev-parse --disambiguate=<prefix>
The new option allows you to feed an ambiguous prefix and enumerate all the objects that share it as a prefix of their object names. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1512-rev-parse-disambiguation.sh')
-rwxr-xr-xt/t1512-rev-parse-disambiguation.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 6de3cb0..3ed7558 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -252,4 +252,13 @@ test_expect_success 'ambiguous commit-ish' '
test_must_fail git log 000000000...
'
+test_expect_success 'rev-parse --disambiguate' '
+ # The test creates 16 objects that share the prefix and two
+ # commits created by commit-tree in earlier tests do not share
+ # the prefix.
+ git rev-parse --disambiguate=000000000 >actual &&
+ test "$(wc -l <actual)" = 16 &&
+ test "$(sed -e "s/^\(.........\).*/\1/" actual | sort -u)" = 000000000
+'
+
test_done