1
0
mirror of https://github.com/git/git.git synced 2024-10-20 21:38:38 +02:00

Merge branch 'ic/maint-rebase-i-abort'

* ic/maint-rebase-i-abort:
  rebase -i: Abort cleanly if new base cannot be checked out
This commit is contained in:
Junio C Hamano 2010-06-21 06:02:50 -07:00
commit 9cb16a92d7
2 changed files with 12 additions and 1 deletions

@ -974,8 +974,9 @@ EOF
test -d "$REWRITTEN" || test -n "$NEVER_FF" || skip_unnecessary_picks
output git checkout $ONTO || die_abort "could not detach HEAD"
git update-ref ORIG_HEAD $HEAD
output git checkout $ONTO && do_rest
do_rest
;;
esac
shift

@ -146,6 +146,16 @@ test_expect_success 'abort' '
! test -d .git/rebase-merge
'
test_expect_success 'abort with error when new base cannot be checked out' '
git rm --cached file1 &&
git commit -m "remove file in base" &&
test_must_fail git rebase -i master > output 2>&1 &&
grep "Untracked working tree file .file1. would be overwritten" \
output &&
! test -d .git/rebase-merge &&
git reset --hard HEAD^
'
test_expect_success 'retain authorship' '
echo A > file7 &&
git add file7 &&