diff options
author | Michael Muré <batolettre@gmail.com> | 2019-08-12 16:12:14 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-08-12 16:12:14 +0200 |
commit | 99b5c58d43137bd9f6503788a55484327b0c531f (patch) | |
tree | 08ecc0f923b5f1fb4e8a7627aeabccb335d92ad1 /identity/identity_actions.go | |
parent | 67a3752e176790e82a48706236f889cab4f8913d (diff) | |
download | git-bug-99b5c58d43137bd9f6503788a55484327b0c531f.tar.gz |
finish the refactoring for the dedicated identifier type
Diffstat (limited to 'identity/identity_actions.go')
-rw-r--r-- | identity/identity_actions.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/identity/identity_actions.go b/identity/identity_actions.go index 40aab8e2..aa6a2a91 100644 --- a/identity/identity_actions.go +++ b/identity/identity_actions.go @@ -59,8 +59,13 @@ func MergeAll(repo repository.ClockedRepo, remote string) <-chan entity.MergeRes } for _, remoteRef := range remoteRefs { - refSplitted := strings.Split(remoteRef, "/") - id := refSplitted[len(refSplitted)-1] + refSplit := strings.Split(remoteRef, "/") + id := entity.Id(refSplit[len(refSplit)-1]) + + if err := id.Validate(); err != nil { + out <- entity.NewMergeInvalidStatus(id, errors.Wrap(err, "invalid ref").Error()) + continue + } remoteIdentity, err := read(repo, remoteRef) |