diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-02-10 14:20:10 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-10 14:20:10 -0800 |
commit | fb795323ce3ce5a358f8e55641777b9cdbeab846 (patch) | |
tree | 886f5c1eaef8861f19bbd8b3d7a364444d9ba9ca /t/t1511-rev-parse-caret.sh | |
parent | 722c9244452c1853f0592b22c331382c282768c7 (diff) | |
parent | 0769854f3db2c09c8b5993ea023ea07ddc1eb6eb (diff) | |
download | git-fb795323ce3ce5a358f8e55641777b9cdbeab846.tar.gz |
Merge branch 'wp/sha1-name-negative-match'
A new "<branch>^{/!-<pattern>}" notation can be used to name a
commit that is reachable from <branch> that does not match the
given <pattern>.
* wp/sha1-name-negative-match:
object name: introduce '^{/!-<negative pattern>}' notation
test for '!' handling in rev-parse's named commits
Diffstat (limited to 't/t1511-rev-parse-caret.sh')
-rwxr-xr-x | t/t1511-rev-parse-caret.sh | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh index 7043ba7947..e0a49a651f 100755 --- a/t/t1511-rev-parse-caret.sh +++ b/t/t1511-rev-parse-caret.sh @@ -18,7 +18,18 @@ test_expect_success 'setup' ' git checkout master && echo modified >>a-blob && git add -u && - git commit -m Modified + git commit -m Modified && + git branch modref && + echo changed! >>a-blob && + git add -u && + git commit -m !Exp && + git branch expref && + echo changed >>a-blob && + git add -u && + git commit -m Changed && + echo changed-again >>a-blob && + git add -u && + git commit -m Changed-again ' test_expect_success 'ref^{non-existent}' ' @@ -77,4 +88,44 @@ test_expect_success 'ref^{/Initial}' ' test_cmp expected actual ' +test_expect_success 'ref^{/!Exp}' ' + test_must_fail git rev-parse master^{/!Exp} +' + +test_expect_success 'ref^{/!}' ' + test_must_fail git rev-parse master^{/!} +' + +test_expect_success 'ref^{/!!Exp}' ' + git rev-parse expref >expected && + git rev-parse master^{/!!Exp} >actual && + test_cmp expected actual +' + +test_expect_success 'ref^{/!-}' ' + test_must_fail git rev-parse master^{/!-} +' + +test_expect_success 'ref^{/!-.}' ' + test_must_fail git rev-parse master^{/!-.} +' + +test_expect_success 'ref^{/!-non-existent}' ' + git rev-parse master >expected && + git rev-parse master^{/!-non-existent} >actual && + test_cmp expected actual +' + +test_expect_success 'ref^{/!-Changed}' ' + git rev-parse expref >expected && + git rev-parse master^{/!-Changed} >actual && + test_cmp expected actual +' + +test_expect_success 'ref^{/!-!Exp}' ' + git rev-parse modref >expected && + git rev-parse expref^{/!-!Exp} >actual && + test_cmp expected actual +' + test_done |