zsh: update git_prune_branches

pull/6/head
bretello 2022-02-07 20:45:59 +01:00
parent c6b110b325
commit fc4972dab3
Signed by: brethil
GPG Key ID: 876AAC6290170FE7
1 changed files with 3 additions and 2 deletions

View File

@ -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() {