Skip to content

Commit 9170c7a

Browse files
committed
unpack-trees: preserve the index file version of original
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 <[email protected]>
1 parent 69dec66 commit 9170c7a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

unpack-trees.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
10201020
o->result.initialized = 1;
10211021
o->result.timestamp.sec = o->src_index->timestamp.sec;
10221022
o->result.timestamp.nsec = o->src_index->timestamp.nsec;
1023+
o->result.version = o->src_index->version;
10231024
o->merge_size = len;
10241025
mark_all_ce_unused(o->src_index);
10251026

0 commit comments

Comments
 (0)