File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 974974
975975 test -d " $REWRITTEN " || test -n " $NEVER_FF " || skip_unnecessary_picks
976976
977+ output git checkout $ONTO || die_abort " could not detach HEAD"
977978 git update-ref ORIG_HEAD $HEAD
978- output git checkout $ONTO && do_rest
979+ do_rest
979980 ;;
980981 esac
981982 shift
Original file line number Diff line number Diff line change @@ -146,6 +146,16 @@ test_expect_success 'abort' '
146146 ! test -d .git/rebase-merge
147147'
148148
149+ test_expect_success ' abort with error when new base cannot be checked out' '
150+ git rm --cached file1 &&
151+ git commit -m "remove file in base" &&
152+ test_must_fail git rebase -i master > output 2>&1 &&
153+ grep "Untracked working tree file .file1. would be overwritten" \
154+ output &&
155+ ! test -d .git/rebase-merge &&
156+ git reset --hard HEAD^
157+ '
158+
149159test_expect_success ' retain authorship' '
150160 echo A > file7 &&
151161 git add file7 &&
You can’t perform that action at this time.
0 commit comments