Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

gps: Insulate against .git as file #1376

Merged
merged 1 commit into from
Nov 15, 2017
Merged

Conversation

sdboyer
Copy link
Member

@sdboyer sdboyer commented Nov 14, 2017

What does this do / why do we need it?

git ls-remote was being run without a current working directory, which - for some versions of git - has the unfortunate side effect of still looking for a local .git in the cwd hierarchy, and failing if that .git is a file instead of a directory (as it might be if the user is working beneath a git submodule).

This relocates the call to somewhere safer, under gps' control, so that we've a better (though not foolproof) guarantee of not colliding with a .git file.

Which issue(s) does this PR fix?

Fixes #1338.

`git ls-remote` was being run without a current working directory, which
- for some versions of git - has the unfortunate side effect of still
looking for a local .git in the cwd hierarchy, and failing if that .git
is a file instead of a directory (as it might be if the user is working
beneath a git submodule).

This relocates the call to somewhere safer, under gps' control, so that
we've a better (though not foolproof) guarantee of not colliding with a
.git file.

Fixes golang#1338.
@sdboyer sdboyer merged commit 2b7a080 into golang:master Nov 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dep fails if .git is not a directory
2 participants