On Mon, 12 Feb 2007, Junio C Hamano wrote:
Not so fast. What's your plan for st_size?
Umm. There's two (very distinct) uses for st_size.
The one that we actually use to validate the current index obviously must
match the "OS returned value". It contains all the CR/LF stuff.
The one where we actually read the file and run SHA1 on the result must
obviously be the post-conversion one.
But it shouldn't be a problem. We'll always know which one matters: the
index case is always about pure stat information (and has no meaning
outside of that, really - after all, it's no different from st_mode etc,
and we actually keep it in a special binary format that is endian-safe!)
and the "real object" case is always about the *data* we use to compare
with.
I don't think we ever mix the two anyway.
Linus