Skip to content

Commit

Permalink
rebase: prepare to do generic housekeeping
Browse files Browse the repository at this point in the history
On successful completion of a rebase in git-rebase--$backend.sh, the
$backend script cleans up on its own and exits.  The cleanup routine
is however, independent of the $backend, and each $backend script
unnecessarily duplicates this work:

    rm -rf "$state_dir"
    git gc --auto

Prepare git-rebase.sh for later patches that return control from each
$backend script back to us, for performing this generic cleanup
routine.  The code that this patch adds is currently unreachable, and
will only start to be used when git-rebase--$backend.sh scripts are
taught to return control in later patches.

Another advantage is that git-rebase.sh can implement a generic
finish_rebase() to possibly do additional tasks in addition to the
cleanup.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramkumar Ramachandra authored and Junio C Hamano committed May 13, 2013
1 parent 1224f3d commit f5f758a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ run_specific_rebase () {
autosquash=
fi
. git-rebase--$type
ret=$?
if test $ret -eq 0
then
git gc --auto &&
rm -rf "$state_dir"
fi
exit $ret
}

run_pre_rebase_hook () {
Expand Down

0 comments on commit f5f758a

Please sign in to comment.