diff options
author | Dennis Stosberg <dennis@stosberg.net> | 2006-05-28 21:08:08 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-28 13:31:50 -0700 |
commit | ac58c7b18ecf1c2ef41c848879e8b1838162db54 (patch) | |
tree | 8ca70b62dc1e1175de4f5ffefd8250cadbb6c037 /read-cache.c | |
parent | Fix crash when reading the empty tree (diff) | |
download | tgif-ac58c7b18ecf1c2ef41c848879e8b1838162db54.tar.xz |
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>
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c index 1f71d12578..5270e834dd 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); |