FIX #535: expand also GIT_DIR var on Repo-construction#537
Merged
Byron merged 5 commits intogitpython-developers:masterfrom Oct 22, 2016
Merged
FIX #535: expand also GIT_DIR var on Repo-construction#537Byron merged 5 commits intogitpython-developers:masterfrom
Byron merged 5 commits intogitpython-developers:masterfrom
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 on construct. + Explain and rename `git.repo.fun.find_git_dir()` is for submodules (`find_submodule_git_dir()`).
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.py git/repo/fun.py git/test/test_submodule.py
ethereon
reviewed
Oct 19, 2016
| 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.
The environment variable taking precedence over the specified path seems error prone and undesirable. For instance, with GIT_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 think GIT_DIR as a fallback makes sense (if path is None for instance). However, is there any reason to prefer it if an explicit path is provided?
FIX gitpython-developers#535 according to Byron's comment: gitpython-developers#535 (comment)
Member
|
Thanks a lot @ankostis :) ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pathparameter.Minor repo-code and doc correcions.
osp.normalize()them.construct.
git.repo.fun.find_git_dir()is for submodules(
find_submodule_git_dir()).