summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-04-27 22:58:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-04-27 23:03:29 (GMT)
commit9170c7ab2889a295de49458d7bd37d82f1556cd6 (patch)
treea0447f3b6ca58a5090cfa65285925043b88a6608
parent69dec66b2f6ab5c8138cca37e74bd405c541318a (diff)
downloadgit-9170c7ab2889a295de49458d7bd37d82f1556cd6.zip
git-9170c7ab2889a295de49458d7bd37d82f1556cd6.tar.gz
git-9170c7ab2889a295de49458d7bd37d82f1556cd6.tar.bz2
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 <gitster@pobox.com>
-rw-r--r--unpack-trees.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 7c9ecf6..2a037d6 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -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);