From: Dennis Stosberg Date: Sun, 28 May 2006 19:08:08 +0000 (+0200) Subject: git-write-tree writes garbage on sparc64 X-Git-Tag: v1.4.0-rc1~45^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ac58c7b18ecf1c2ef41c848879e8b1838162db54;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/read-cache.c b/read-cache.c index 1f71d1257..5270e834d 100644 --- a/read-cache.c +++ b/read-cache.c @@ -643,7 +643,7 @@ static int ce_write(SHA_CTX *context, int fd, void *data, unsigned int len) } static int write_index_ext_header(SHA_CTX *context, int fd, - unsigned long ext, unsigned long sz) + unsigned int ext, unsigned int sz) { ext = htonl(ext); sz = htonl(sz);