-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: "go get" ignores github default branch #9032
Comments
The cloning works file with Go1.4 and Go1.5 ac45234. Only the branch checkout is wrong. |
The default branch feature is only available at Github isn't a Git feature. We can get the default branch information from Github API (https://developer.github.com/v3/repos/#get). Want we really at special Github handling to go get? |
This could potentially really slow down go get. GitHub clones to your default branch, I believe. (Maybe I'm wrong). Just silently fail if no master is found? |
Sure it slow down it, and I don't want to have. I've created a test repo with two branches b and c and no master branch. The branch b is the default Gibhub branch. Cloning over git clone works well. The b branch is checked out. Cloning over go get fails with:
That's okay, at the moment go get assumes master is always present. I think we should find the right Git default branch if master is not present. But we should not use the Github API to find the default Github branch. |
CL https://golang.org/cl/5312 mentions this issue. |
FWIW, CL 5312 says it resolves this issue, but it's not clear to me if meant to resolve a subset, or if that was unintentional. What it resolves is that if a default branch was not master and Now, that error no longer happens because However, I'm inclined to think it's not intentional however. The commit message in CL 5312 says:
But that is not true (about resolving GitHub default branch issue). Here are reproduce steps:
However, that repo is configured to have https://github.com/shurcooL-legacy/go-get-default-branch I'm running (I'm only reporting this because it was on my TODO list to investigate the possible discrepancy between the commit message in this CL and actual behavior.) |
CL https://golang.org/cl/18334 mentions this issue. |
One side effect of the fix removing It doesn't look like the removal of |
Just for the record (and in case anybody else lands here like I did) this is being tracked on the godep side in tools/godep#453 |
The text was updated successfully, but these errors were encountered: