diff options
author | Nanako Shiraishi <nanako3@lavabit.com> | 2010-01-07 20:05:09 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-07 11:15:20 -0800 |
commit | 230a4566382860fc26a3f8d578a41c6504cf865f (patch) | |
tree | 00ccc093720791cc427e9a7b929f9ce5730483f9 /t/t3415-rebase-onto-threedots.sh | |
parent | 9f21e97ddccf114a6919cf4b8cf57c2838328f36 (diff) | |
download | git-230a4566382860fc26a3f8d578a41c6504cf865f.tar.gz git-230a4566382860fc26a3f8d578a41c6504cf865f.tar.xz |
rebase -i: teach --onto A...B syntax
When rewriting commits on a topic branch, sometimes it is easier to
compare the version of commits before and after the rewrite if they are
based on the same commit that forked from the upstream. An earlier commit
by Junio (fixed up by the previous commit) gives "--onto A...B" syntax to
rebase command, and rebases on top of the merge base between A and B;
teach the same to the interactive version, too.
Signed-off-by: しらいし ななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3415-rebase-onto-threedots.sh')
-rwxr-xr-x | t/t3415-rebase-onto-threedots.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t3415-rebase-onto-threedots.sh b/t/t3415-rebase-onto-threedots.sh index b09e907c3..ddf2f6485 100755 --- a/t/t3415-rebase-onto-threedots.sh +++ b/t/t3415-rebase-onto-threedots.sh @@ -72,4 +72,34 @@ test_expect_success 'rebase --onto master...side' ' test_must_fail git rebase --onto master...side J ' +test_expect_success 'rebase -i --onto master...topic' ' + git reset --hard && + git checkout topic && + git reset --hard G && + set_fake_editor && + EXPECT_COUNT=1 git rebase -i --onto master...topic F && + git rev-parse HEAD^1 >actual && + git rev-parse C^0 >expect && + test_cmp expect actual +' + +test_expect_success 'rebase -i --onto master...' ' + git reset --hard && + git checkout topic && + git reset --hard G && + set_fake_editor && + EXPECT_COUNT=1 git rebase -i --onto master... F && + git rev-parse HEAD^1 >actual && + git rev-parse C^0 >expect && + test_cmp expect actual +' + +test_expect_success 'rebase -i --onto master...side' ' + git reset --hard && + git checkout side && + git reset --hard K && + + test_must_fail git rebase -i --onto master...side J +' + test_done |