zsh:alias:git-base-branch: Fix small pattern error

In place of the in ed215a35f7 introduced
second bracket can also stand `~` or `^`.
Otherwise something like `[feature^] or [feature~2]` is not thrown out.
This commit is contained in:
2021-05-16 00:04:46 +02:00
parent c1955dd5f5
commit d0aee7e638

View File

@@ -35,7 +35,7 @@
# https://nilansanjaya.wordpress.com/2017/06/02/git-find-base-branch/ # https://nilansanjaya.wordpress.com/2017/06/02/git-find-base-branch/
git_bb='git show-branch -a 2>/dev/null' git_bb='git show-branch -a 2>/dev/null'
git_bb+=' | grep "^[^[]*[*-].*\["' git_bb+=' | grep "^[^[]*[*-].*\["'
git_bb+=' | grep -v "^[^[]*\[$(git rev-parse --abbrev-ref HEAD)\]"' git_bb+=' | grep -v "^[^[]*\[$(git rev-parse --abbrev-ref HEAD)[]~^]"'
git_bb+=' | head -n1' git_bb+=' | head -n1'
git_bb+=' | sed -E "s/^[^[]*\[([^]~^]*).*$/\1/"' git_bb+=' | sed -E "s/^[^[]*\[([^]~^]*).*$/\1/"'
alias git-base-branch="$git_bb" alias git-base-branch="$git_bb"