summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asp.in1
-rw-r--r--package.inc.sh8
-rw-r--r--remote.inc.sh4
3 files changed, 12 insertions, 1 deletions
diff --git a/asp.in b/asp.in
index cb983a4..bbfd7e1 100644
--- a/asp.in
+++ b/asp.in
@@ -156,6 +156,7 @@ untrack() {
package_init -n "$pkgname" remote || return 1
remote_untrack "$remote" "$pkgname"
+ package_untrack "$pkgname" "$remote"
}
disk_usage() {
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
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
}