From 36e7b8652dfcbc04506a5f30eaa485cc83766b15 Mon Sep 17 00:00:00 2001 From: David Celis Date: Wed, 23 Dec 2015 21:15:34 -0500 Subject: [PATCH] Fix pruning of local branches for git-sync Signed-off-by: David Celis --- local/bin/git-prune-merged | 3 +-- local/bin/git-sync | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/local/bin/git-prune-merged b/local/bin/git-prune-merged index 0f67040..d980c6f 100755 --- a/local/bin/git-prune-merged +++ b/local/bin/git-prune-merged @@ -9,8 +9,7 @@ git branch --list --merged | # Prune all remote branches that have been merged into the specified remote's # master. Defaults to `origin`. -git fetch $remote -git remote prune $remote +git fetch $remote --prune git branch --list --remote --merged $remote/master | grep --invert-match --extended-regexp 'HEAD|master' | grep $remote | sed "s/ *$remote\\///" | diff --git a/local/bin/git-sync b/local/bin/git-sync index 1a9b96a..3d067d2 100755 --- a/local/bin/git-sync +++ b/local/bin/git-sync @@ -92,7 +92,7 @@ git branch --list | \ if has_upstream_configuration "$local_branch"; then remote_branch="$(upstream_branch "$local_branch")" || gone=1 elif [ ! -e "${GIT_DIR}/${remote_branch}" ]; then - remote_branch="" + remote_branch="" && gone=1 fi if [ -n "$remote_branch" ]; then -- 2.51.2