Fix index writing

This commit is contained in:
Nathan McRae 2024-07-10 21:41:10 -07:00
parent dbe3bca439
commit ff78648324

View File

@ -814,7 +814,7 @@ class GitIndexEntry (object):
# Group ID of the owner
self.gid = gid
# Size of this object, in bytes
self.fize = fsize
self.fsize = fsize
# The object's SHA
self.sha = sha
self.flag_assume_valid = flag_assume_valid
@ -1223,6 +1223,9 @@ def index_write(repo, index):
f.write(mode.to_bytes(4, "big"))
f.write(e.uid.to_bytes(4, "big"))
f.write(e.gid.to_bytes(4, "big"))
f.write(e.fsize.to_bytes(4, "big"))
# FIXME: Convert back to int.
f.write(int(e.sha, 16).to_bytes(20, "big"))