diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-12 14:00:34 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-12 14:00:34 -0700 |
commit | eaff724bbc9c8f838b6d65fff9959da968939c3a (patch) | |
tree | 34f4a3cdd4f3a79c5b4f96e3278b234a60386f88 /t | |
parent | Merge branch 'jc/maint-doc-checkout-b-always-takes-branch-name' into maint-1.... (diff) | |
parent | specifying ranges: we did not mean to make ".." an empty set (diff) | |
download | tgif-eaff724bbc9c8f838b6d65fff9959da968939c3a.tar.xz |
Merge branch 'jc/dotdot-is-parent-directory' into maint-1.7.11
"git log .." errored out saying it is both rev range and a path when
there is no disambiguating "--" is on the command line. Update the
command line parser to interpret ".." as a path in such a case.
* jc/dotdot-is-parent-directory:
specifying ranges: we did not mean to make ".." an empty set
Diffstat (limited to 't')
-rwxr-xr-x | t/t1506-rev-parse-diagnosis.sh | 14 | ||||
-rwxr-xr-x | t/t4202-log.sh | 7 |
2 files changed, 21 insertions, 0 deletions
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh index c5cb77a0e1..f950c10128 100755 --- a/t/t1506-rev-parse-diagnosis.sh +++ b/t/t1506-rev-parse-diagnosis.sh @@ -182,4 +182,18 @@ test_expect_success '<commit>:file correctly diagnosed after a pathname' ' test_cmp expect actual ' +test_expect_success 'dotdot is not an empty set' ' + ( H=$(git rev-parse HEAD) && echo $H && echo ^$H ) >expect && + + git rev-parse HEAD.. >actual && + test_cmp expect actual && + + git rev-parse ..HEAD >actual && + test_cmp expect actual && + + echo .. >expect && + git rev-parse .. >actual && + test_cmp expect actual +' + test_done diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 71be59d446..45058cc8cb 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -806,4 +806,11 @@ test_expect_success 'log --graph with diff and stats' ' test_cmp expect actual.sanitized ' +test_expect_success 'dotdot is a parent directory' ' + mkdir -p a/b && + ( echo sixth && echo fifth ) >expect && + ( cd a/b && git log --format=%s .. ) >actual && + test_cmp expect actual +' + test_done |