summaryrefslogtreecommitdiff
path: root/write-tree.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-15 10:44:27 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-15 10:44:27 -0700
commitccc4feb579265266d0a4a73c0c9443ecc0c26ce3 (patch)
tree9999cff451d3a833ca39981d6868fdb452449f13 /write-tree.c
parent27de946d0ee70fad497253bbaab76d2fa7b1c77c (diff)
downloadgit-ccc4feb579265266d0a4a73c0c9443ecc0c26ce3.tar.gz
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 'write-tree.c')
-rw-r--r--write-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/write-tree.c b/write-tree.c
index 881c8c2b58..e2bbbd261e 100644
--- a/write-tree.c
+++ b/write-tree.c
@@ -45,7 +45,7 @@ static int write_tree(struct cache_entry **cachep, int maxentries, const char *b
do {
struct cache_entry *ce = cachep[nr];
const char *pathname = ce->name, *filename, *dirname;
- int pathlen = ce->namelen, entrylen;
+ int pathlen = ce_namelen(ce), entrylen;
unsigned char *sha1;
unsigned int mode;
@@ -54,7 +54,7 @@ static int write_tree(struct cache_entry **cachep, int maxentries, const char *b
break;
sha1 = ce->sha1;
- mode = ce->st_mode;
+ mode = ntohl(ce->ce_mode);
/* Do we have _further_ subdirectories? */
filename = pathname + baselen;