summaryrefslogtreecommitdiffstats
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2014-03-19 12:02:15 +0100
committerJunio C Hamano <gitster@pobox.com>2014-03-19 18:52:51 +0100
commit4f4074077fb0c3a2facc61b333337d024aeeebbf (patch)
tree8a478388eb4a4dccbeac8cf2db8cebf964cc3644 /git-rebase.sh
parentGit 1.9.0 (diff)
downloadgit-4f4074077fb0c3a2facc61b333337d024aeeebbf.tar.xz
git-4f4074077fb0c3a2facc61b333337d024aeeebbf.zip
rebase: allow "-" short-hand for the previous branch
Teach rebase the same shorthand as checkout and merge to name the branch to rebase the current branch on; that is, that "-" means "the branch we were previously on". Requested-by: Tim Chase <git@tim.thechases.com> Signed-off-by: Brian Gesiak <modocache@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 8a3efa2983..658c003c14 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -449,6 +449,10 @@ then
test "$fork_point" = auto && fork_point=t
;;
*) upstream_name="$1"
+ if test "$upstream_name" = "-"
+ then
+ upstream_name="@{-1}"
+ fi
shift
;;
esac