Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression: impossible to pull or push files that are none existant either locally or remotely directly #536

Closed
odeke-em opened this issue Dec 28, 2015 · 0 comments
Assignees
Milestone

Comments

@odeke-em
Copy link
Owner

This bug was reported by @memeplex in the interaction in issue #535. I reproduced and acknowledged it in #535 (comment).
It is an offset of PR #528, caused by the new pattern remote.FindByPathM -- multiple which returns a channel. Originally a call

         files, err := req.Do()

        if err != nil {
                if err.Error() == ErrGoogleApiInvalidQueryHardCoded.Error() { // Send the user back the query information
                        err = fmt.Errorf("err: %v query: `%s`", err, expr)
                }
                return nil, err
        }

        if files == nil || len(files.Items) < 1 {
                return nil, ErrPathNotExists
        }

        first := files.Items[0]
        if len(p) == 1 {
                return NewRemoteFile(first), nil
        }
        return r.findByPathRecvRaw(first.Id, p[1:], trashed)

The original pattern guaranteed the reporting of unmatched files

and yet now

or rem := range remotesChan {
   ....
}

// Will never be run if the file didn't exist upstream.

yet at no point was a lack of the first match ever propagated back with the empty file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant