diff options
Diffstat (limited to 'identity/identity_actions.go')
-rw-r--r-- | identity/identity_actions.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/identity/identity_actions.go b/identity/identity_actions.go index da7a064c..53997eef 100644 --- a/identity/identity_actions.go +++ b/identity/identity_actions.go @@ -12,7 +12,7 @@ import ( // This does not change the local identities state func Fetch(repo repository.Repo, remote string) (string, error) { remoteRefSpec := fmt.Sprintf(identityRemoteRefPattern, remote) - fetchRefSpec := fmt.Sprintf("%s:%s*", identityRefPattern, remoteRefSpec) + fetchRefSpec := fmt.Sprintf("%s*:%s*", identityRefPattern, remoteRefSpec) return repo.FetchRefs(remote, fetchRefSpec) } @@ -23,8 +23,7 @@ func Push(repo repository.Repo, remote string) (string, error) { } // Pull will do a Fetch + MergeAll -// This function won't give details on the underlying process. If you need more, -// use Fetch and MergeAll separately. +// This function will return an error if a merge fail func Pull(repo repository.ClockedRepo, remote string) error { _, err := Fetch(repo, remote) if err != nil { @@ -36,9 +35,7 @@ func Pull(repo repository.ClockedRepo, remote string) error { return merge.Err } if merge.Status == MergeStatusInvalid { - // Not awesome: simply output the merge failure here as this function - // is only used in tests for now. - fmt.Println(merge) + return errors.Errorf("merge failure: %s", merge.Reason) } } @@ -64,7 +61,7 @@ func MergeAll(repo repository.ClockedRepo, remote string) <-chan MergeResult { refSplitted := strings.Split(remoteRef, "/") id := refSplitted[len(refSplitted)-1] - remoteIdentity, err := ReadLocal(repo, remoteRef) + remoteIdentity, err := read(repo, remoteRef) if err != nil { out <- newMergeInvalidStatus(id, errors.Wrap(err, "remote identity is not readable").Error()) |