diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-11-29 18:06:22 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2010-11-29 18:06:22 +0200 |
commit | 91e8894150a84235e827e418c6a942753215897c (patch) | |
tree | 975c4da266e10b4f86b93904aa72737d4d16b8e9 | |
parent | a84972d0c4d18061812a1c83809baf921969e77d (diff) | |
download | libgit2-91e8894150a84235e827e418c6a942753215897c.tar.gz |
Properly write Index Entry 'flags_extended'
Always write the 'flags_extended' attribute to disk if it's available.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
-rw-r--r-- | src/index.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/index.c b/src/index.c index 238dc2406..bb8cddd85 100644 --- a/src/index.c +++ b/src/index.c @@ -529,6 +529,8 @@ static size_t read_entry(git_index_entry *dest, const void *buffer, size_t buffe if (INDEX_FOOTER_SIZE + minimal_entry_size > buffer_size) return 0; + memset(dest, 0x0, sizeof(git_index_entry)); + source = (const struct entry_short *)(buffer); dest->ctime.seconds = ntohl(source->ctime.seconds); @@ -764,6 +766,10 @@ int git_index__write(git_index *index, git_filelock *file) WRITE_WORD(entry->gid); WRITE_WORD(entry->file_size); WRITE_BYTES(entry->oid.id, GIT_OID_RAWSZ); + + if (entry->flags_extended != 0) + entry->flags |= GIT_IDXENTRY_EXTENDED; + WRITE_SHORT(entry->flags); if (entry->flags & GIT_IDXENTRY_EXTENDED) { |