Skip to content

Commit 33819a2

Browse files
committed
Addiitonal win32 fixes related to, guess it, backslashes in paths
1 parent 17a1729 commit 33819a2

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/git/index/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
LockedFD,
5757
join_path_native,
5858
file_contents_ro,
59+
to_native_path_linux,
60+
to_native_path
5961
)
6062

6163
from fun import (
@@ -672,7 +674,7 @@ def add(self, items, force=True, fprogress=lambda *args: None, path_rewriter=Non
672674
gitrelative_path = abspath[len(self.repo.working_tree_dir)+1:]
673675
blob = Blob(self.repo, Blob.NULL_BIN_SHA,
674676
self._stat_mode_to_index_mode(os.stat(abspath).st_mode),
675-
gitrelative_path)
677+
to_native_path_linux(gitrelative_path))
676678
entries.append(BaseIndexEntry.from_blob(blob))
677679
# END for each path
678680
del(paths[:])
@@ -692,7 +694,7 @@ def store_path(filepath):
692694
istream = self.repo.odb.store(IStream(Blob.type, st.st_size, stream))
693695
fprogress(filepath, True, filepath)
694696
return BaseIndexEntry((self._stat_mode_to_index_mode(st.st_mode),
695-
istream.binsha, 0, filepath))
697+
istream.binsha, 0, to_native_path_linux(filepath)))
696698
# END utility method
697699

698700

lib/git/remote.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
TagReference
2222
)
2323

24-
from gitdb.util import (
25-
join,
26-
)
24+
from git.util import join_path
25+
from gitdb.util import join
26+
2727
import re
2828
import os
2929

@@ -366,7 +366,7 @@ def _from_line(cls, repo, line, fetch_line):
366366
if ref_type is SymbolicReference:
367367
remote_local_ref = ref_type(repo, "FETCH_HEAD")
368368
else:
369-
remote_local_ref = Reference.from_path(repo, join(ref_type._common_path_default, remote_local_ref.strip()))
369+
remote_local_ref = Reference.from_path(repo, join_path(ref_type._common_path_default, remote_local_ref.strip()))
370370
# END create ref instance
371371

372372
note = ( note and note.strip() ) or ''

0 commit comments

Comments
 (0)