path: root/tree.c
diff options
authorLinus Torvalds <>2008-01-15 00:03:17 (GMT)
committerLinus Torvalds <>2008-01-21 20:44:31 (GMT)
commit7a51ed66f653c248993b3c4a61932e47933d835e (patch)
treeeb40e8e3b00979deee24e0a03a32b5f25d1f275e /tree.c
parentce33288ea6b81a2f4f5aecd72177bcc8174562ae (diff)
Make on-disk index representation separate from in-core one
This converts the index explicitly on read and write to its on-disk format, allowing the in-core format to contain more flags, and be simpler. In particular, the in-core format is now host-endian (as opposed to the on-disk one that is network endian in order to be able to be shared across machines) and as a result we can dispense with all the htonl/ntohl on accesses to the cache_entry fields. This will make it easier to make use of various temporary flags that do not exist in the on-disk format. Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'tree.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/tree.c b/tree.c
index 8c0819f..87708ef 100644
--- a/tree.c
+++ b/tree.c
@@ -142,8 +142,8 @@ static int cmp_cache_name_compare(const void *a_, const void *b_)
ce1 = *((const struct cache_entry **)a_);
ce2 = *((const struct cache_entry **)b_);
- return cache_name_compare(ce1->name, ntohs(ce1->ce_flags),
- ce2->name, ntohs(ce2->ce_flags));
+ return cache_name_compare(ce1->name, ce1->ce_flags,
+ ce2->name, ce2->ce_flags);
int read_tree(struct tree *tree, int stage, const char **match)