make USE_NSEC work as expected
[git/git.git] / unpack-trees.c
index 273b5da..11902cd 100644 (file)
@@ -360,8 +360,12 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
 
        memset(&o->result, 0, sizeof(o->result));
        o->result.initialized = 1;
-       if (o->src_index)
-               o->result.timestamp = o->src_index->timestamp;
+       if (o->src_index) {
+               o->result.timestamp.sec = o->src_index->timestamp.sec;
+#ifdef USE_NSEC
+               o->result.timestamp.nsec = o->src_index->timestamp.nsec;
+#endif
+       }
        o->merge_size = len;
 
        if (!dfc)