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. --- package.inc.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'package.inc.sh') diff --git a/package.inc.sh b/package.inc.sh index 1456baf..6d6407f 100644 --- a/package.inc.sh +++ b/package.inc.sh @@ -141,6 +141,14 @@ package_get_repos() { printf '%s\n' "${!repos[@]}" } +package_untrack() { + local pkgname=$1 remote=$2 + + if git show-ref -q "refs/heads/$remote/packages/$pkgname"; then + git branch -D "$remote/packages/$pkgname" + fi +} + _package_shortlog() { local pkgname=$1 remote=$2 -- cgit v1.2.3-54-g00ecf