Merge branch 'rr/rebase-sha1-by-string-query'
authorJunio C Hamano <gitster@pobox.com>
Mon, 24 Jun 2013 20:48:40 +0000 (13:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Jun 2013 20:48:40 +0000 (13:48 -0700)
Allow various commit objects to be given to "git rebase" by ':/look
for this string' syntax, e.g. "git rebase --onto ':/there'".

* rr/rebase-sha1-by-string-query:
rebase: use peel_committish() where appropriate
sh-setup: add new peel_committish() helper
t/rebase: add failing tests for a peculiar revision

1  2 
git-rebase.sh
t/t3400-rebase.sh
t/t3404-rebase-interactive.sh
diff --cc git-rebase.sh
Simple merge
index ff86725b7beba19c138b33bd874d31fd540c026e,cbca71ed56bd4443cbfc1f4842eb589b6beeae16..ebf93b0695dfac37fc276e1f07377d858eb3e1da
@@@ -59,6 -66,39 +59,17 @@@ test_expect_success 'rebase against mas
        git rebase master
  '
  
 -test_expect_success 'rebase against master twice' '
 -      git rebase master >out &&
 -      test_i18ngrep "Current branch my-topic-branch is up to date" out
 -'
 -
 -test_expect_success 'rebase against master twice with --force' '
 -      git rebase --force-rebase master >out &&
 -      test_i18ngrep "Current branch my-topic-branch is up to date, rebase forced" out
 -'
 -
 -test_expect_success 'rebase against master twice from another branch' '
 -      git checkout my-topic-branch^ &&
 -      git rebase master my-topic-branch >out &&
 -      test_i18ngrep "Current branch my-topic-branch is up to date" out
 -'
 -
 -test_expect_success 'rebase fast-forward to master' '
 -      git checkout my-topic-branch^ &&
 -      git rebase my-topic-branch >out &&
 -      test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out
 -'
 -
+ test_expect_success 'rebase, with <onto> and <upstream> specified as :/quuxery' '
+       test_when_finished "git branch -D torebase" &&
+       git checkout -b torebase my-topic-branch^ &&
+       upstream=$(git rev-parse ":/Add B") &&
+       onto=$(git rev-parse ":/Add A") &&
+       git rebase --onto $onto $upstream &&
+       git reset --hard my-topic-branch^ &&
+       git rebase --onto ":/Add A" ":/Add B" &&
+       git checkout my-topic-branch
+ '
  test_expect_success 'the rebase operation should not have destroyed author information' '
        ! (git log | grep "Author:" | grep "<>")
  '
Simple merge