From eab3a16099e364f62303d5bbeca002ac14f697be Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 17 Aug 2014 23:39:43 -0400 Subject: cleanup local tracking branches when untracking Also, make both package_untrack and remote_untrack robust against partially existing branches. --- remote.inc.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'remote.inc.sh') diff --git a/remote.inc.sh b/remote.inc.sh index 2cce6ba..f7e5539 100644 --- a/remote.inc.sh +++ b/remote.inc.sh @@ -82,5 +82,7 @@ remote_get_url() { remote_untrack() { local remote=$1 pkgname=$2 - git branch -dr "$remote/packages/$pkgname" + if git show-ref -q "refs/remotes/$remote/packages/$pkgname"; then + git branch -dr "$remote/packages/$pkgname" + fi } -- cgit v1.2.3-70-g09d2