1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-10 20:26:14 +02:00

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>
This commit is contained in:
Dennis Stosberg 2006-05-28 21:08:08 +02:00 committed by Junio C Hamano
parent b6c4a480b3
commit ac58c7b18e

View File

@ -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);