From 4f4074077fb0c3a2facc61b333337d024aeeebbf Mon Sep 17 00:00:00 2001 From: Brian Gesiak Date: Wed, 19 Mar 2014 20:02:15 +0900 Subject: 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 Signed-off-by: Brian Gesiak Signed-off-by: Junio C Hamano --- git-rebase.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'git-rebase.sh') 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 -- cgit v1.2.1