diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-19 16:01:47 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-19 16:01:47 +0200 |
commit | 9d5d143f72e4d588e3a0abb2ab82fa5a2c35e8aa (patch) | |
tree | 01f02c1aff9dbf5aa04bc862a47364af6987ba38 /git/repo/fun.py | |
parent | b29388a8f9cf3522e5f52b47572af7d8f61862a1 (diff) | |
download | gitpython-9d5d143f72e4d588e3a0abb2ab82fa5a2c35e8aa.tar.gz |
repo: minor code and doc correcions.
+ 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()`).
Diffstat (limited to 'git/repo/fun.py')
-rw-r--r-- | git/repo/fun.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/git/repo/fun.py b/git/repo/fun.py index 320eb1c8..fe0896a9 100644 --- a/git/repo/fun.py +++ b/git/repo/fun.py @@ -20,7 +20,7 @@ from git.exc import WorkTreeRepositoryUnsupported from git.compat import xrange -__all__ = ('rev_parse', 'is_git_dir', 'touch', 'find_git_dir', 'name_to_object', 'short_to_long', 'deref_tag', +__all__ = ('rev_parse', 'is_git_dir', 'touch', 'find_submodule_git_dir', 'name_to_object', 'short_to_long', 'deref_tag', 'to_commit') @@ -49,7 +49,8 @@ def is_git_dir(d): return False -def find_git_dir(d): +def find_submodule_git_dir(d): + """Search for a submodule repo.""" if is_git_dir(d): return d @@ -64,7 +65,7 @@ def find_git_dir(d): path = content[8:] if not os.path.isabs(path): path = join(dirname(d), path) - return find_git_dir(path) + return find_submodule_git_dir(path) # end handle exception return None |