diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-02 15:58:53 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-02 15:58:53 -0700 |
commit | 9a92cd1ce60babd661080f2b6a54f57fbfe133ae (patch) | |
tree | 2bd4fb36fbc1fd793e287effc1cf7a45ad3c8ec2 /t | |
parent | db400949b31a5d2cec923b4c9da710fbdd52cca2 (diff) | |
parent | 84cf246670eab56a23ed5554ed084053a0f19f2d (diff) | |
download | git-9a92cd1ce60babd661080f2b6a54f57fbfe133ae.tar.gz git-9a92cd1ce60babd661080f2b6a54f57fbfe133ae.tar.xz |
Merge branch 'jc/strbuf-branchname-fix'
"git merge @{-1}~22" was rewritten to "git merge frotz@{1}~22"
incorrectly when your previous branch was "frotz" (it should be
rewritten to "git merge frotz~22" instead).
* jc/strbuf-branchname-fix:
strbuf_branchname(): do not double-expand @{-1}~22
Diffstat (limited to 't')
-rwxr-xr-x | t/t0100-previous.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/t/t0100-previous.sh b/t/t0100-previous.sh index 315b9b3f1..e0a694023 100755 --- a/t/t0100-previous.sh +++ b/t/t0100-previous.sh @@ -27,6 +27,7 @@ test_expect_success 'merge @{-1}' ' test_commit B && git checkout A && test_commit C && + test_commit D && git branch -f master B && git branch -f other && git checkout other && @@ -35,14 +36,24 @@ test_expect_success 'merge @{-1}' ' git cat-file commit HEAD | grep "Merge branch '\''other'\''" ' -test_expect_success 'merge @{-1} when there is not enough switches yet' ' +test_expect_success 'merge @{-1}~1' ' + git checkout master && + git reset --hard B && + git checkout other && + git checkout master && + git merge @{-1}~1 && + git cat-file commit HEAD >actual && + grep "Merge branch '\''other'\''" actual +' + +test_expect_success 'merge @{-100} before checking out that many branches yet' ' git reflog expire --expire=now && git checkout -f master && git reset --hard B && git branch -f other C && git checkout other && git checkout master && - test_must_fail git merge @{-12} + test_must_fail git merge @{-100} ' test_done |