summaryrefslogtreecommitdiff
path: root/read-tree.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-15 17:44:27 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-15 17:44:27 (GMT)
commitccc4feb579265266d0a4a73c0c9443ecc0c26ce3 (patch)
tree9999cff451d3a833ca39981d6868fdb452449f13 /read-tree.c
parent27de946d0ee70fad497253bbaab76d2fa7b1c77c (diff)
downloadgit-ccc4feb579265266d0a4a73c0c9443ecc0c26ce3.zip
git-ccc4feb579265266d0a4a73c0c9443ecc0c26ce3.tar.gz
git-ccc4feb579265266d0a4a73c0c9443ecc0c26ce3.tar.bz2
Convert the index file reading/writing to use network byte order.
This allows using a git tree over NFS with different byte order, and makes it possible to just copy a fully populated repository and have the end result immediately usable (needing just a refresh to update the stat information).
Diffstat (limited to 'read-tree.c')
-rw-r--r--read-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/read-tree.c b/read-tree.c
index 9aec97f..5c6588d 100644
--- a/read-tree.c
+++ b/read-tree.c
@@ -13,8 +13,8 @@ static int read_one_entry(unsigned char *sha1, const char *base, int baselen, co
memset(ce, 0, size);
- ce->st_mode = mode;
- ce->namelen = baselen + len;
+ ce->ce_mode = htonl(mode);
+ ce->ce_namelen = htons(baselen + len);
memcpy(ce->name, base, baselen);
memcpy(ce->name + baselen, pathname, len+1);
memcpy(ce->sha1, sha1, 20);