summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>2011-02-06 13:43:52 -0500
committerJunio C Hamano <gitster@pobox.com>2011-02-10 14:08:09 -0800
commit2959c283662c62e90d08d3795073534f278deee6 (patch)
tree1d3e65a0c32d82b9fe6e35e49a0172d0809ae866 /git-rebase.sh
parent4974c2caa215a78dd0c6e3665e23e029d98cbbeb (diff)
downloadgit-2959c283662c62e90d08d3795073534f278deee6.tar.gz
rebase: factor out sub command handling
Factor out the common parts of the handling of the sub commands '--continue', '--skip' and '--abort'. The '--abort' handling can handled completely in git-rebase.sh. After this refactoring, the calls to git-rebase--am.sh, git-rebase--merge.sh and git-rebase--interactive.sh will be better aligned. There will only be one call to interactive rebase that will shortcut the very last part of git-rebase.sh. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 42d635bc29..21bb0276e1 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -70,7 +70,12 @@ test "$(git config --bool rebase.autosquash)" = "true" && autosquash=t
read_basic_state () {
head_name=$(cat "$state_dir"/head-name) &&
onto=$(cat "$state_dir"/onto) &&
- orig_head=$(cat "$state_dir"/orig-head) &&
+ if test "$type" = interactive
+ then
+ orig_head=$(cat "$state_dir"/head)
+ else
+ orig_head=$(cat "$state_dir"/orig-head)
+ fi &&
GIT_QUIET=$(cat "$state_dir"/quiet)
}
@@ -262,11 +267,19 @@ test $# -gt 2 && usage
if test -n "$action"
then
test -z "$in_progress" && die "No rebase in progress?"
- test "$type" = interactive && run_specific_rebase
+ # Only interactive rebase uses detailed reflog messages
+ if test "$type" = interactive && test "$GIT_REFLOG_ACTION" = rebase
+ then
+ GIT_REFLOG_ACTION="rebase -i ($action)"
+ export GIT_REFLOG_ACTION
+ fi
fi
case "$action" in
continue)
+ # Sanity check
+ git rev-parse --verify HEAD >/dev/null ||
+ die "Cannot read HEAD"
git update-index --ignore-submodules --refresh &&
git diff-files --quiet --ignore-submodules || {
echo "You must edit all merge conflicts and then"