Parcourir la source

If honor_filemode is false, ignore filemode when

Koen Martens il y a 8 ans
Parent
commit
692be7db07
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      dulwich/index.py

+ 3 - 0
dulwich/index.py

@@ -504,6 +504,9 @@ def build_index_from_tree(root_path, index_path, object_store, tree_id,
             honor_filemode=honor_filemode)
         # Add file to index
         st = os.lstat(full_path)
+        if not honor_filemode:
+            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()