From fc4972dab3d6daa8eb9c62627d87a3b15195b0e7 Mon Sep 17 00:00:00 2001 From: bretello Date: Mon, 7 Feb 2022 20:45:59 +0100 Subject: [PATCH] zsh: update git_prune_branches --- functions.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions.zsh b/functions.zsh index c02ad00..63a8d5c 100755 --- a/functions.zsh +++ b/functions.zsh @@ -230,9 +230,10 @@ function unzipd { unzip -d "$name" "$zip_file" } -# remove local branches which have been merged into master +# remove local branches which have been merged into master/main function git_prune_branches(){ - git branch --merged master | grep -v '^[ * ]*master$' | xargs git branch -d + local main=$(git_main_branch) + git branch --merged $main | grep -v '^[ * ]*'$main'$' | xargs git branch -d } fvim() {