summaryrefslogtreecommitdiff
path: root/t/t3400-rebase.sh
diff options
context:
space:
mode:
authorLibravatar Brian Gesiak <modocache@gmail.com>2014-03-19 20:02:15 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-03-19 10:52:51 -0700
commit4f4074077fb0c3a2facc61b333337d024aeeebbf (patch)
tree8a478388eb4a4dccbeac8cf2db8cebf964cc3644 /t/t3400-rebase.sh
parentGit 1.9.0 (diff)
downloadtgif-4f4074077fb0c3a2facc61b333337d024aeeebbf.tar.xz
rebase: allow "-" short-hand for the previous branch
Teach rebase the same shorthand as checkout and merge to name the branch to rebase the current branch on; that is, that "-" means "the branch we were previously on". Requested-by: Tim Chase <git@tim.thechases.com> Signed-off-by: Brian Gesiak <modocache@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3400-rebase.sh')
-rwxr-xr-xt/t3400-rebase.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 6d94b1fcd9..80e0a951ea 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -88,6 +88,23 @@ test_expect_success 'rebase from ambiguous branch name' '
git rebase master
'
+test_expect_success 'rebase off of the previous branch using "-"' '
+ git checkout master &&
+ git checkout HEAD^ &&
+ git rebase @{-1} >expect.messages &&
+ git merge-base master HEAD >expect.forkpoint &&
+
+ git checkout master &&
+ git checkout HEAD^ &&
+ git rebase - >actual.messages &&
+ git merge-base master HEAD >actual.forkpoint &&
+
+ test_cmp expect.forkpoint actual.forkpoint &&
+ # the next one is dubious---we may want to say "-",
+ # instead of @{-1}, in the message
+ test_i18ncmp expect.messages actual.messages
+'
+
test_expect_success 'rebase a single mode change' '
git checkout master &&
git branch -D topic &&