File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 275
275
die " No rebase in progress?"
276
276
277
277
git rerere clear
278
- if test -d " $dotest "
279
- then
280
- GIT_QUIET=$( cat " $dotest /quiet" )
281
- move_to_original_branch
282
- else
283
- dotest=" $GIT_DIR " /rebase-apply
284
- GIT_QUIET=$( cat " $dotest /quiet" )
285
- move_to_original_branch
286
- fi
278
+
279
+ test -d " $dotest " || dotest=" $GIT_DIR " /rebase-apply
280
+
281
+ head_name=" $( cat " $dotest " /head-name) " &&
282
+ case " $head_name " in
283
+ refs/* )
284
+ git symbolic-ref HEAD $head_name ||
285
+ die " Could not move back to $head_name "
286
+ ;;
287
+ esac
287
288
git reset --hard $( cat " $dotest /orig-head" )
288
289
rm -r " $dotest "
289
290
exit
Original file line number Diff line number Diff line change @@ -72,6 +72,18 @@ testrebase() {
72
72
test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
73
73
test ! -d "$dotest"
74
74
'
75
+
76
+ test_expect_success " rebase$type --abort does not update reflog" '
77
+ cd "$work_dir" &&
78
+ # Clean up the state from the previous one
79
+ git reset --hard pre-rebase &&
80
+ git reflog show to-rebase > reflog_before &&
81
+ test_must_fail git rebase$type master &&
82
+ git rebase --abort &&
83
+ git reflog show to-rebase > reflog_after &&
84
+ test_cmp reflog_before reflog_after &&
85
+ rm reflog_before reflog_after
86
+ '
75
87
}
76
88
77
89
testrebase " " .git/rebase-apply
You can’t perform that action at this time.
0 commit comments