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
pip.vcs.git should use --work-tree instead of implicit $CWD #1130
Comments
Could you provide a test case that demonstrate where pip fails exactly? |
Setup:
Fail:
|
I can confirm this problem, same issue here. A real world example triggering this unwanted behavior is running pip from inside a git repository's post-update hook. Besides setting --work-tree explicitly, another solution would be unsetting GIT_DIR (and GIT_WORK_TREE). |
I posted PR #4666 to address this. (Note that the tests are fine even though the Travis CI icon shows failure. There seems to be flakiness in the Travis CI test runs lately.) |
Address issue #1130 (GIT_DIR and GIT_WORK_TREE).
The Git backend (
pip.vcs.git
) relies on the fact that Git uses$CWD
as the repository directory. The problem is that the environment variables$GIT_DIR
/$GIT_WORK_TREE
can be used to overwrite that, and then always the same repository will be queried instead of the one identified inlocation
.So instead
$CWD
,pip.vcs.git
should always specify--work-tree
.http://git-scm.com/blog/2010/04/11/environment.html
Alternatively, it could just unset those variables before invoking
git
.The text was updated successfully, but these errors were encountered: