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 974
974
975
975
test -d " $REWRITTEN " || test -n " $NEVER_FF " || skip_unnecessary_picks
976
976
977
+ output git checkout $ONTO || die_abort " could not detach HEAD"
977
978
git update-ref ORIG_HEAD $HEAD
978
- output git checkout $ONTO && do_rest
979
+ do_rest
979
980
;;
980
981
esac
981
982
shift
Original file line number Diff line number Diff line change @@ -146,6 +146,16 @@ test_expect_success 'abort' '
146
146
! test -d .git/rebase-merge
147
147
'
148
148
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
+
149
159
test_expect_success ' retain authorship' '
150
160
echo A > file7 &&
151
161
git add file7 &&
You can’t perform that action at this time.
0 commit comments