Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
FIX #535: expand also GIT_DIR var on Repo-construction#537
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
+ Ignore "empty" GIT_DIR vars.+ Improve documentation on the constructor `path` parameter.
+ Expansion of paths also `osp.normalize()` them.+ Make Repo-fields --> class-fields to avoid initializations onconstruct.+ Explain and rename `git.repo.fun.find_git_dir()` is for submodules(`find_submodule_git_dir()`).
codecov-io commentedOct 19, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Current coverage is 94.36% (diff: 96.77%)@@ master #537 diff @@========================================== Files 63 63 Lines 9885 9892 +7 Methods 0 0 Messages 0 0 Branches 0 0 ==========================================+ Hits 9326 9335 +9+ Misses 559 557 -2 Partials 0 0
|
Conflicts:git/repo/base.pygit/repo/fun.pygit/test/test_submodule.py
@@ -124,6 +124,8 @@ def __init__(self, path=None, odbt=DefaultDBType, search_parent_directories=Fals | |||
repo = Repo("~/Development/git-python.git") | |||
repo = Repo("$REPOSITORIES/Development/git-python.git") | |||
if `None, current-directory is used. | |||
The :envvar:`GIT_DIR` if set and not empty takes precendance over this parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The environment variable taking precedence over the specified path seems error prone and undesirable. For instance, withGIT_DIR
set, you can no longer do something like this:
repo_1 = git.Repo('/path/to/repo1')repo_2 = git.Repo('/path/to/repo2')
I thinkGIT_DIR
as a fallback makes sense (ifpath
isNone
for instance). However, is there any reason to prefer it if an explicit path is provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Discussion moved to original issue#535
FIXgitpython-developers#535 according to Byron's comment:gitpython-developers#535 (comment)
Thanks a lot@ankostis :) ! |
path
parameter.Minor repo-code and doc correcions.
osp.normalize()
them.construct.
git.repo.fun.find_git_dir()
is for submodules(
find_submodule_git_dir()
).