aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug.go
diff options
context:
space:
mode:
authorvince <vincetiu8@gmail.com>2020-07-20 09:55:14 +0800
committerMichael Muré <batolettre@gmail.com>2020-07-28 14:30:05 +0200
commit4e4ca106aea25da74f1df49d33f4eaa272a6e8f0 (patch)
treea019a325fbafe1fe4ae5a834302eb6cd2e8a3f62 /bug/bug.go
parent36f300cb35b203310e923cf956310c7f20ed7406 (diff)
downloadgit-bug-4e4ca106aea25da74f1df49d33f4eaa272a6e8f0.tar.gz
Allow user to delete remote bugs
Diffstat (limited to 'bug/bug.go')
-rw-r--r--bug/bug.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/bug/bug.go b/bug/bug.go
index 04bd5996..95c4325f 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -242,11 +242,18 @@ func readBug(repo repository.ClockedRepo, ref string) (*Bug, error) {
return &bug, nil
}
+// RemoveLocalBug will remove a local bug from its hash
func RemoveLocalBug(repo repository.ClockedRepo, id entity.Id) error {
ref := bugsRefPattern + id.String()
return repo.RemoveRef(ref)
}
+// RemoveRemoteBug will remove a remote bug locally from its hash
+func RemoveRemoteBug(repo repository.ClockedRepo, remote string, id entity.Id) error {
+ ref := fmt.Sprintf(bugsRemoteRefPattern, remote) + id.String()
+ return repo.RemoveRef(ref)
+}
+
type StreamedBug struct {
Bug *Bug
Err error