diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-05 17:59:30 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-05 17:59:30 +0100 |
commit | 9ee861ae7a7b36a811aa4b5cc8172c5cbd6a945b (patch) | |
tree | 5d10bf275b67704b8873f1b0bd3cc4d55469d8a3 /lib/git/refs.py | |
parent | 453995f70f93c0071c5f7534f58864414f01cfde (diff) | |
download | gitpython-9ee861ae7a7b36a811aa4b5cc8172c5cbd6a945b.tar.gz |
Added utilities helping to create proper paths either with slashes or backslashes depending on the operating system
fixed test_refs and test_trees
Many more issues remain though, this is just a first backup commit
Diffstat (limited to 'lib/git/refs.py')
-rw-r--r-- | lib/git/refs.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/git/refs.py b/lib/git/refs.py index 5b94ea07..b0996878 100644 --- a/lib/git/refs.py +++ b/lib/git/refs.py @@ -8,7 +8,7 @@ import os from objects import Object, Commit from objects.utils import get_object_type_by_name -from utils import LazyMixin, Iterable +from utils import LazyMixin, Iterable, join_path, join_path_native, to_native_path_linux class Reference(LazyMixin, Iterable): """ @@ -136,15 +136,15 @@ class Reference(LazyMixin, Iterable): # walk loose refs # Currently we do not follow links - for root, dirs, files in os.walk(os.path.join(repo.path, common_path)): + for root, dirs, files in os.walk(join_path_native(repo.path, common_path)): for f in files: - abs_path = os.path.join(root, f) - rela_paths.add(abs_path.replace(repo.path + '/', "")) + abs_path = to_native_path_linux(join_path(root, f)) + rela_paths.add(abs_path.replace(to_native_path_linux(repo.path) + '/', "")) # END for each file in root directory # END for each directory to walk # read packed refs - packed_refs_path = os.path.join(repo.path, 'packed-refs') + packed_refs_path = join_path_native(repo.path, 'packed-refs') if os.path.isfile(packed_refs_path): fp = open(packed_refs_path, 'r') try: @@ -230,7 +230,7 @@ class SymbolicReference(object): return hash(self.name) def _get_path(self): - return os.path.join(self.repo.path, self.name) + return join_path_native(self.repo.path, self.name) def _get_commit(self): """ |