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

Potential Mercury Bug #84

Open
pierrebeaucamp opened this issue Nov 24, 2017 · 2 comments
Open

Potential Mercury Bug #84

pierrebeaucamp opened this issue Nov 24, 2017 · 2 comments
Labels

Comments

@pierrebeaucamp
Copy link

Hi,

A tool I'm using is looking up some repository information using this library. I kept on getting a "The remote does not match the VCS endpoint" error so I investigated a bit.

Turns out that this library is getting called as follows: repo, err := vcs.NewRepo("", repoRoot). Notice the empty remote address which works fine for Git repositories but it seems to fail for Mercurial.

I think this is a bug in https://github.com/Masterminds/vcs/blob/master/hg.go#L47:

m := hgDetectURL.FindStringSubmatch(string(out))
if m[1] != "" && m[1] != remote {
        return nil, ErrWrongRemote
}

should be instead:

m := hgDetectURL.FindStringSubmatch(string(out))
if remote != "" && m[1] != remote {
        return nil, ErrWrongRemote
}

I just wanted to ask if this is intended behaviour or a bug. In case this is a bug, I'd be happy to open a PR.

@mattfarina
Copy link
Member

@pierrebeaucamp You are right that this is a bug. If you want to file a PR I'd be happy to review.

Sorry for the slow response. I was a little underwater on a couple other things.

@mattfarina mattfarina added the bug label Dec 20, 2017
@pierrebeaucamp
Copy link
Author

I'll give it a swing this weekend

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

No branches or pull requests

2 participants