aboutsummaryrefslogtreecommitdiffstats
path: root/repository/git.go
diff options
context:
space:
mode:
authorVincent Tiu <46623413+Invincibot@users.noreply.github.com>2020-07-09 20:40:44 +0800
committerGitHub <noreply@github.com>2020-07-09 14:40:44 +0200
commitf3304bdc1c215e733b9a2ee6a228e64f663c2b09 (patch)
tree44e21d3922b270dfe92a49361567775e684a292a /repository/git.go
parentde062a78ece6a33cc44d8bd3372d814b288ce916 (diff)
downloadgit-bug-f3304bdc1c215e733b9a2ee6a228e64f663c2b09.tar.gz
Add functionality to remove bugs from a local repository. (#423)
Add functionality to remove bugs from a local repository. This adds a function to remove git references in the repo and another one to remove bugs.
Diffstat (limited to 'repository/git.go')
-rw-r--r--repository/git.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/repository/git.go b/repository/git.go
index 22055dbb..3d756324 100644
--- a/repository/git.go
+++ b/repository/git.go
@@ -282,6 +282,13 @@ func (repo *GitRepo) UpdateRef(ref string, hash Hash) error {
return err
}
+// RemoveRef will remove a Git reference
+func (repo *GitRepo) RemoveRef(ref string) error {
+ _, err := repo.runGitCommand("update-ref", "-d", ref)
+
+ return err
+}
+
// ListRefs will return a list of Git ref matching the given refspec
func (repo *GitRepo) ListRefs(refspec string) ([]string, error) {
stdout, err := repo.runGitCommand("for-each-ref", "--format=%(refname)", refspec)