diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2008-10-10 13:42:12 +0200 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-10-10 08:32:03 -0700 |
commit | ff74126c03a8dfd04e7533573a5c420f2a7112ac (patch) | |
tree | deb3f4fa7b69bf1574706bbc57c62cd5b984c820 /git-rebase--interactive.sh | |
parent | b8eecafd888d219633f4c29e8b6a90fc21a46dfd (diff) | |
download | git-ff74126c03a8dfd04e7533573a5c420f2a7112ac.tar.gz git-ff74126c03a8dfd04e7533573a5c420f2a7112ac.tar.xz |
rebase -i: do not fail when there is no commit to cherry-pick
In case there is no commit to apply (for example because you rebase to
upstream and all your local patches have been applied there), do not
fail. The non-interactive rebase already behaves that way.
Do this by introducing a new command, "noop", which is substituted for
an empty commit list, so that deleting the commit list can still abort
as before.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-x | git-rebase--interactive.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index bdec43c3f..124cb5846 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -277,7 +277,7 @@ do_next () { "$DOTEST"/amend || exit read command sha1 rest < "$TODO" case "$command" in - '#'*|'') + '#'*|''|noop) mark_action_done ;; pick|p) @@ -584,6 +584,7 @@ first and then run 'git rebase --continue' again." --abbrev=7 --reverse --left-right --cherry-pick \ $UPSTREAM...$HEAD | \ sed -n "s/^>/pick /p" > "$TODO" + test -s "$TODO" || echo noop >> "$TODO" cat >> "$TODO" << EOF # Rebase $SHORTUPSTREAM..$SHORTHEAD onto $SHORTONTO |