aboutsummaryrefslogtreecommitdiffstats
path: root/entity/refs.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-04-09 13:01:14 +0200
committerMichael Muré <batolettre@gmail.com>2021-04-09 13:01:14 +0200
commit1520f678f7a2bc6e01d9b01df5ce49f2f46be7d7 (patch)
treef6d71c1f29cf06ccab9e4ae434b19ab17caa4385 /entity/refs.go
parent0fd570171d171aa574d7f01d6033a9c01d668465 (diff)
parentbc5f618eba812859bf87ce2c31b278bd518d4555 (diff)
downloadgit-bug-1520f678f7a2bc6e01d9b01df5ce49f2f46be7d7.tar.gz
Merge remote-tracking branch 'origin/master' into dev-gh-bridge
Diffstat (limited to 'entity/refs.go')
-rw-r--r--entity/refs.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/entity/refs.go b/entity/refs.go
index 82b1741b..070d4dba 100644
--- a/entity/refs.go
+++ b/entity/refs.go
@@ -2,17 +2,19 @@ package entity
import "strings"
+// RefsToIds parse a slice of git references and return the corresponding Entity's Id.
func RefsToIds(refs []string) []Id {
ids := make([]Id, len(refs))
for i, ref := range refs {
- ids[i] = refToId(ref)
+ ids[i] = RefToId(ref)
}
return ids
}
-func refToId(ref string) Id {
+// RefsToIds parse a git reference and return the corresponding Entity's Id.
+func RefToId(ref string) Id {
split := strings.Split(ref, "/")
return Id(split[len(split)-1])
}