diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2011-05-10 10:21:26 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-05-10 10:21:26 +0200 |
commit | cd26aaebbda94dc3740e41bbd3f91ba6b1a25c10 (patch) | |
tree | 7ea33a01a8a33b3cea92e0f6872bb1c7b5279a5e /git/refs/symbolic.py | |
parent | 7ae36c3e019a5cc16924d1b6007774bfb625036f (diff) | |
download | gitpython-cd26aaebbda94dc3740e41bbd3f91ba6b1a25c10.tar.gz |
Made repository paths methods a property to be compatible with the existing repo interface. Added submodule interface ... goal is to provide all of the extra repo functionality in custom interfaces
Diffstat (limited to 'git/refs/symbolic.py')
-rw-r--r-- | git/refs/symbolic.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index 1a0d3566..d670bd47 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -82,11 +82,11 @@ class SymbolicReference(object): @property def abspath(self): - return join_path_native(self.repo.git_path(), self.path) + return join_path_native(self.repo.git_dir, self.path) @classmethod def _get_packed_refs_path(cls, repo): - return join(repo.git_path(), 'packed-refs') + return join(repo.git_dir, 'packed-refs') @classmethod def _iter_packed_refs(cls, repo): @@ -139,7 +139,7 @@ class SymbolicReference(object): point to, or None""" tokens = None try: - fp = open(join(repo.git_path(), ref_path), 'r') + fp = open(join(repo.git_dir, ref_path), 'r') value = fp.read().rstrip() fp.close() tokens = value.split(" ") @@ -416,7 +416,7 @@ class SymbolicReference(object): or just "myreference", hence 'refs/' is implied. Alternatively the symbolic reference to be deleted""" full_ref_path = cls.to_full_path(path) - abs_path = join(repo.git_path(), full_ref_path) + abs_path = join(repo.git_dir, full_ref_path) if exists(abs_path): os.remove(abs_path) else: @@ -469,7 +469,7 @@ class SymbolicReference(object): corresponding object and a detached symbolic reference will be created instead""" full_ref_path = cls.to_full_path(path) - abs_ref_path = join(repo.git_path(), full_ref_path) + abs_ref_path = join(repo.git_dir, full_ref_path) # figure out target data target = reference @@ -550,8 +550,8 @@ class SymbolicReference(object): if self.path == new_path: return self - new_abs_path = join(self.repo.git_path(), new_path) - cur_abs_path = join(self.repo.git_path(), self.path) + new_abs_path = join(self.repo.git_dir, new_path) + cur_abs_path = join(self.repo.git_dir, self.path) if isfile(new_abs_path): if not force: # if they point to the same file, its not an error @@ -581,7 +581,7 @@ class SymbolicReference(object): # walk loose refs # Currently we do not follow links - for root, dirs, files in os.walk(join_path_native(repo.git_path(), common_path)): + for root, dirs, files in os.walk(join_path_native(repo.git_dir, common_path)): if 'refs/' not in root: # skip non-refs subfolders refs_id = [ i for i,d in enumerate(dirs) if d == 'refs' ] if refs_id: @@ -590,7 +590,7 @@ class SymbolicReference(object): for f in files: abs_path = to_native_path_linux(join_path(root, f)) - rela_paths.add(abs_path.replace(to_native_path_linux(repo.git_path()) + '/', "")) + rela_paths.add(abs_path.replace(to_native_path_linux(repo.git_dir) + '/', "")) # END for each file in root directory # END for each directory to walk |