Don't fail running virtualenv inside of a git hook
Review Request #3945 - Created May 29, 2016 and submitted
|benjyw, gmalmquist, molsen, stuhood|
There were instances when the detection of GIT_ROOT failed. Now we check
GIT_HOOKin the environment, and if it is true, just assume that the script is already running at the root of the repo.
Manually tested by:
git commitfrom different directories in the repo after a
git clean -fdx.
- running the
virtualenvcommand from different working directories.
Used to fail running
git commit -aon the command line after a git clean with the following error:Checking packages Checking imports ./build-support/virtualenv: line 10: /Users/zundel/Src/pants/build-support/build-support/common.sh: No such file or directory Failed to create venv. To fix import sort order, run `build-support/bin/isort.sh -f`
CI is green at https://travis-ci.org/pantsbuild/pants/builds/134105451
Logic was reversed before. I re-tested manually after these changes and ran it back through the CI builder.
Revision 2 (+5 -1)
Status: Closed (submitted)
Thanks Stu & Garrett. Commit 224b2ec