aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-11-22 15:33:08 +0100
committerGitHub <noreply@github.com>2020-11-22 15:33:08 +0100
commit2f4ca77f778f93dc1a4a3ff00c6ac1422ea99101 (patch)
treed74abbbdaeba39d9c92e64d1114965f99df25613 /bug
parentc03b2d96945fbf912847bffb8953ded79cb97959 (diff)
parent647b05eee4b612f33a2f22576821ea1c012d7c84 (diff)
downloadgit-bug-2f4ca77f778f93dc1a4a3ff00c6ac1422ea99101.tar.gz
Merge pull request #499 from MichaelMure/remove-identity
add remove identity feature
Diffstat (limited to 'bug')
-rw-r--r--bug/bug.go21
1 files changed, 3 insertions, 18 deletions
diff --git a/bug/bug.go b/bug/bug.go
index 6f5d0a7a..f6c35a2d 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -234,7 +234,7 @@ func RemoveBug(repo repository.ClockedRepo, id entity.Id) error {
return err
}
if len(refs) > 1 {
- return NewErrMultipleMatchBug(refsToIds(refs))
+ return NewErrMultipleMatchBug(entity.RefsToIds(refs))
}
if len(refs) == 1 {
// we have the bug locally
@@ -253,7 +253,7 @@ func RemoveBug(repo repository.ClockedRepo, id entity.Id) error {
return err
}
if len(remoteRefs) > 1 {
- return NewErrMultipleMatchBug(refsToIds(refs))
+ return NewErrMultipleMatchBug(entity.RefsToIds(refs))
}
if len(remoteRefs) == 1 {
// found the bug in a remote
@@ -337,22 +337,7 @@ func ListLocalIds(repo repository.Repo) ([]entity.Id, error) {
return nil, err
}
- return refsToIds(refs), nil
-}
-
-func refsToIds(refs []string) []entity.Id {
- ids := make([]entity.Id, len(refs))
-
- for i, ref := range refs {
- ids[i] = refToId(ref)
- }
-
- return ids
-}
-
-func refToId(ref string) entity.Id {
- split := strings.Split(ref, "/")
- return entity.Id(split[len(split)-1])
+ return entity.RefsToIds(refs), nil
}
// Validate check if the Bug data is valid