Sfoglia il codice sorgente

Revert formatting change in index.py that breaks windows compatibility.

Koen Martens 8 anni fa
parent
commit
f7a549e164
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7 1
      dulwich/index.py

+ 7 - 1
dulwich/index.py

@@ -508,7 +508,13 @@ def build_index_from_tree(root_path, index_path, object_store, tree_id,
         # Add file to index
         st = os.lstat(full_path)
         if not honor_filemode or S_ISGITLINK(entry.mode):
-            st = st.__class__((entry.mode, ) + st[1:])
+            # we can not use tuple slicing to build a new tuple,
+            # because on windows that will convert the times to
+            # longs, which causes errors further along
+            st_tuple = (entry.mode, st.st_ino, st.st_dev, st.st_nlink,
+                        st.st_uid, st.st_gid, st.st_size, st.st_atime,
+                        st.st_mtime, st.st_ctime)
+            st = st.__class__(st_tuple)
         index[entry.path] = index_entry_from_stat(st, entry.sha, 0)
 
     index.write()