diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-15 13:11:16 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-16 02:46:31 +0200 |
commit | 0210e394e0776d0b7097bf666bebd690ed0c0e4f (patch) | |
tree | e74014dd49c93f75b8cf388d700b681a321d261b /git/repo/fun.py | |
parent | a2d248bb8362808121f6b6abfd316d83b65afa79 (diff) | |
download | gitpython-0210e394e0776d0b7097bf666bebd690ed0c0e4f.tar.gz |
src: import os.path as osp
Diffstat (limited to 'git/repo/fun.py')
-rw-r--r-- | git/repo/fun.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/git/repo/fun.py b/git/repo/fun.py index 320eb1c8..c770fd43 100644 --- a/git/repo/fun.py +++ b/git/repo/fun.py @@ -2,12 +2,14 @@ import os from string import digits +from git.compat import xrange +from git.exc import WorkTreeRepositoryUnsupported +from git.objects import Object +from git.refs import SymbolicReference from gitdb.exc import ( BadObject, BadName, ) -from git.refs import SymbolicReference -from git.objects import Object from gitdb.util import ( join, isdir, @@ -16,8 +18,8 @@ from gitdb.util import ( hex_to_bin, bin_to_hex ) -from git.exc import WorkTreeRepositoryUnsupported -from git.compat import xrange + +import os.path as osp __all__ = ('rev_parse', 'is_git_dir', 'touch', 'find_git_dir', 'name_to_object', 'short_to_long', 'deref_tag', @@ -42,7 +44,7 @@ def is_git_dir(d): if isdir(join(d, 'objects')) and isdir(join(d, 'refs')): headref = join(d, 'HEAD') return isfile(headref) or \ - (os.path.islink(headref) and + (osp.islink(headref) and os.readlink(headref).startswith('refs')) elif isfile(join(d, 'gitdir')) and isfile(join(d, 'commondir')) and isfile(join(d, 'gitfile')): raise WorkTreeRepositoryUnsupported(d) @@ -62,7 +64,7 @@ def find_git_dir(d): else: if content.startswith('gitdir: '): path = content[8:] - if not os.path.isabs(path): + if not osp.isabs(path): path = join(dirname(d), path) return find_git_dir(path) # end handle exception |