Commit ac58c7b1 authored by Dennis Stosberg's avatar Dennis Stosberg Committed by Junio C Hamano

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: default avatarDennis Stosberg <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent b6c4a480
......@@ -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);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment