Skip to content

Commit

Permalink
unpack-trees: preserve the index file version of original
Browse files Browse the repository at this point in the history
Otherwise "git checkout $other_branch" (or even "git checkout HEAD")
would end up writing the index out in the default format.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Apr 27, 2012
1 parent 69dec66 commit 9170c7a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions unpack-trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
o->result.initialized = 1;
o->result.timestamp.sec = o->src_index->timestamp.sec;
o->result.timestamp.nsec = o->src_index->timestamp.nsec;
o->result.version = o->src_index->version;
o->merge_size = len;
mark_all_ce_unused(o->src_index);

Expand Down

0 comments on commit 9170c7a

Please sign in to comment.