From 8cbbf9095a7693b6f5a0128831c276d11be9d6e8 Mon Sep 17 00:00:00 2001 From: Richard Fearn Date: Sat, 19 Nov 2016 17:41:18 +0000 Subject: [PATCH] git-delete-merged-branches: use "xargs -r" to prevent error when there are no branches to delete Prevents this error: $ git delete-merged-branches fatal: branch name required --- bin/git-delete-merged-branches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-delete-merged-branches b/bin/git-delete-merged-branches index 354bfb486..2a4e044c5 100755 --- a/bin/git-delete-merged-branches +++ b/bin/git-delete-merged-branches @@ -1,3 +1,3 @@ #!/usr/bin/env bash -git branch --no-color --merged | grep -v "\*" | grep -v master | grep -v svn | xargs -n 1 git branch -d +git branch --no-color --merged | grep -v "\*" | grep -v master | grep -v svn | xargs -r -n 1 git branch -d