-
Notifications
You must be signed in to change notification settings - Fork 43
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
GIT_DIR is not respected #58
Comments
I'm assuming this issue is raised because git up doesn't work correctly if you are working in a work tree created by In this case I'm not sure if the correct way to get the repository is From a little experimentation |
You are correct. I use vcsh (https://github.com/RichiH/vcsh) which separates the worktree from the git-dir. After reading the documentation --git-common-dir seem to be the correct way |
Thanks for the bug report and the details everyone! I've implemented a fix, but it seems like the git version on Travis doesn't support git's worktree. @kwbr Could you install the latest dev version (should work using |
Seems to work now. 👍 Installed it with |
Awesome! Version 1.4.4 has been released now :) |
Should fix #59. The bugfix to #58 was faulty when PyGitUp was run from a subfolder as `git rev-parse --git-common-dir` is not equivalent to `git rev-parse --show-toplevel` when run in a subfolder as it returns a relative path in cases like this. Now `--git-common-dir` is used when executed in a worktree, otherwise `--show-toplevel` is used.
The way git-up tries to get the path to the repository is not working when the GIT_WORK_TREE and GIT_DIR are different.
get_git_dir()
tries to get the repository withreturn execute(['git', 'rev-parse', '--show-toplevel'])
As far as I understand
--git-dir
should be used.http://stackoverflow.com/a/21085415
The text was updated successfully, but these errors were encountered: