summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2015-02-24 20:38:39 +0000
committerTails developers <amnesia@boum.org>2015-02-24 20:38:39 +0000
commite7427ade72e1ea7b45fa6dd95d18187773ded8b2 (patch)
tree317df3d097c5400e685dfe9cdee9a416fa3c4d78 /bin
parent9f131f6b4c65a285c7612c03186050490d5a4704 (diff)
Take into account the asterisk that highlights the checked-out local branch.
I broke this when making the regexps a bit tighter.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/git-delete-branches4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/git-delete-branches b/bin/git-delete-branches
index 56960c9..88327e8 100755
--- a/bin/git-delete-branches
+++ b/bin/git-delete-branches
@@ -40,7 +40,7 @@ git fetch --prune "$MANAGED_REMOTE"
REMOTE_BR=$(git branch -r --merged | grep -v '\->' |\
grep -vE "^\s+([^/]+)/($(generate "$BRANCHES_TO_KEEP"))$" |\
grep -E "^\s+$MANAGED_REMOTE/")
-LOCAL_BR=$(git branch --merged | grep -Ev "^\s+($(generate "$BRANCHES_TO_KEEP"))$")
+LOCAL_BR=$(git branch --merged | grep -Ev "^\*?\s+($(generate "$BRANCHES_TO_KEEP"))$")
if [ -z "$REMOTE_BR" ] && [ -z "$LOCAL_BR" ]; then
echo "Woohoo! No unmerged branches!" >&2
@@ -68,7 +68,7 @@ else
done
echo "$REFS" | xargs -n30 git push "$MANAGED_REMOTE"
if [ -n "$LOCAL_BR" ]; then
- git branch --merged | grep -Ev "^\s+($(generate "$BRANCHES_TO_KEEP"))$" | xargs -n30 git branch -d
+ git branch --merged | grep -Ev "^\*?\s+($(generate "$BRANCHES_TO_KEEP"))$" | xargs -n30 git branch -d
fi
;;
*)