Skip to content

Commit 15d4bf2

Browse files
artagnongitster
authored andcommitted
rebase -i: return control to caller, for housekeeping
Return control to the caller git-rebase.sh to get these two tasks rm -fr "$dotest" git gc --auto done by it. Signed-off-by: Ramkumar Ramachandra <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a1549e1 commit 15d4bf2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

git-rebase--interactive.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,17 +628,16 @@ do_next () {
628628
"$GIT_DIR"/hooks/post-rewrite rebase < "$rewritten_list"
629629
true # we don't care if this hook failed
630630
fi &&
631-
rm -rf "$state_dir" &&
632-
git gc --auto &&
633631
warn "Successfully rebased and updated $head_name."
634632

635-
exit
633+
return 1 # not failure; just to break the do_rest loop
636634
}
637635

636+
# can only return 0, when the infinite loop breaks
638637
do_rest () {
639638
while :
640639
do
641-
do_next
640+
do_next || break
642641
done
643642
}
644643

@@ -805,11 +804,13 @@ first and then run 'git rebase --continue' again."
805804

806805
require_clean_work_tree "rebase"
807806
do_rest
807+
return 0
808808
;;
809809
skip)
810810
git rerere clear
811811

812812
do_rest
813+
return 0
813814
;;
814815
edit-todo)
815816
git stripspace --strip-comments <"$todo" >"$todo".new

0 commit comments

Comments
 (0)