-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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: build fails when using GIT_DIR environment variable #56862
Comments
@horacimacias, what was the complete |
running
|
So, probably a good starting point would be to fix |
adding -v gave a bit more information:
looks like that go/src/cmd/go/internal/vcs/vcs.go Lines 245 to 248 in ebb71ad
In case this is of any help, in my case I have a "root" project git the "normal" Running
|
are there any tests on this feature I can have a look at? if somebody points me to some starting point I may be able to contribute with a PR |
@horacimacias, the existing tests for VCS stamping are in |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Create a project with the
.git
folder being renamed astestgit
instead of the default.git
.All git operations function normally as long as GIT_DIR=testgit is passed through the environment.
Try to build the project using
What did you expect to see?
Success building project
What did you see instead?
error obtaining VCS status: exit status 128 Use -buildvcs=false to disable VCS stamping.
Looks like
go build
is not considering that the git directory may have been overriden using GIT_DIR.If I rename my
testgit
folder to the default.git
and do not useGIT_DIR
environment variable,go build ./...
succeeds.The text was updated successfully, but these errors were encountered: