Merge branch 'do/rebase-i-arbitrary'
authorJunio C Hamano <gitster@pobox.com>
Sat, 3 Apr 2010 19:28:38 +0000 (12:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 3 Apr 2010 19:28:38 +0000 (12:28 -0700)
* do/rebase-i-arbitrary:
rebase--interactive: don't require what's rebased to be a branch

Conflicts:
t/t3404-rebase-interactive.sh

git-rebase--interactive.sh
t/t3404-rebase-interactive.sh
index 1d116bfae2175891905d40ba4b55b331fba63372..2ff211cbaa928275857577535f02ae92cb407f2f 100755 (executable)
@@ -823,8 +823,6 @@ first and then run 'git rebase --continue' again."
 
                if test ! -z "$1"
                then
-                       output git show-ref --verify --quiet "refs/heads/$1" ||
-                               die "Invalid branchname: $1"
                        output git checkout "$1" ||
                                die "Could not checkout $1"
                fi
index 19668c2c9206c5dfe63a5992bc7d011a9cdb4083..b0b43c6d329cacf24fd9ea6d69320e13d34b154c 100755 (executable)
@@ -577,4 +577,13 @@ test_expect_success 'rebase -i can copy notes over a fixup' '
        test_cmp expect output
 '
 
+test_expect_success 'rebase while detaching HEAD' '
+       git symbolic-ref HEAD &&
+       grandparent=$(git rev-parse HEAD~2) &&
+       test_tick &&
+       FAKE_LINES="2 1" git rebase -i HEAD~2 HEAD^0 &&
+       test $grandparent = $(git rev-parse HEAD~2) &&
+       test_must_fail git symbolic-ref HEAD
+'
+
 test_done