aboutsummaryrefslogtreecommitdiffstats
path: root/entity/refs.go
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 /entity/refs.go
parentc03b2d96945fbf912847bffb8953ded79cb97959 (diff)
parent647b05eee4b612f33a2f22576821ea1c012d7c84 (diff)
downloadgit-bug-2f4ca77f778f93dc1a4a3ff00c6ac1422ea99101.tar.gz
Merge pull request #499 from MichaelMure/remove-identity
add remove identity feature
Diffstat (limited to 'entity/refs.go')
-rw-r--r--entity/refs.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/entity/refs.go b/entity/refs.go
new file mode 100644
index 00000000..82b1741b
--- /dev/null
+++ b/entity/refs.go
@@ -0,0 +1,18 @@
+package entity
+
+import "strings"
+
+func RefsToIds(refs []string) []Id {
+ ids := make([]Id, len(refs))
+
+ for i, ref := range refs {
+ ids[i] = refToId(ref)
+ }
+
+ return ids
+}
+
+func refToId(ref string) Id {
+ split := strings.Split(ref, "/")
+ return Id(split[len(split)-1])
+}