From 9331a7426643cce6d45a16c171645fffc557eb50 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Mon, 24 Oct 2022 15:24:19 +0000 Subject: [PATCH] aliases: Fix gfrb/gfrbi with slash-delimited branches Multi-part branch names would be incorrectly split on the last slash and not the first, causing these aliases to do the wrong thing. These need the remote name which is the first element. Everything after the first slash is the branch name, not the last slash. Signed-off-by: Joe Groocock --- aliases | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliases b/aliases index 99f016c..ed72aad 100644 --- a/aliases +++ b/aliases @@ -139,8 +139,8 @@ alias grbc="grb --continue" alias grbsk="grb --skip" alias grbsh="grb --show-current" alias grbom="git rebase \"origin/\$(git defbranch)\"" -gfrb() { remote="${1%/*}"; git fetch "$remote" && git rebase "$@"; } -gfrbi() { remote="${1%/*}"; git fetch "$remote" && git rebase -i "$@"; } +gfrb() { remote="${1%%/*}"; git fetch "$remote" && git rebase "$@"; } +gfrbi() { remote="${1%%/*}"; git fetch "$remote" && git rebase -i "$@"; } alias gam="git am" alias gama="git am --abort"