@matheusbsbs / matheus-bagliano / commits / ac58c7b18e
Fork 0

git-write-tree writes garbage on sparc64

In the "next" branch, write_index_ext_header() writes garbage on a 64-bit big-endian machine; the written index file will be unreadable. I noticed this on NetBSD/sparc64. Reproducible with: $ git init-db $ :>file $ git-update-index --add file $ git-write-tree $ git-update-index error: index uses extension, which we do not understand fatal: index file corrupt Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Dennis Stosberg committed May 28, 2006 at 21:08 UTC ac58c7b18ecf1c2ef41c848879e8b1838162db54
1 file changed +1 -1
read-cache.c
+1 -1
@@ -643,7 +643,7 @@ static int ce_write(SHA_CTX *context, int fd, void *data, unsigned int len)
643 }
644
645 static int write_index_ext_header(SHA_CTX *context, int fd,
646 - unsigned long ext, unsigned long sz)
646 + unsigned int ext, unsigned int sz)
647 {
648 ext = htonl(ext);
649 sz = htonl(sz);