rust/hg-core/src/dirstate_tree/on_disk.rs
changeset 49164 a932cad26d37
parent 49147 10b9f11daf15
parent 49156 09984dc70352
child 49365 79b2c98ab7b4
--- a/rust/hg-core/src/dirstate_tree/on_disk.rs	Mon Apr 25 11:09:33 2022 +0200
+++ b/rust/hg-core/src/dirstate_tree/on_disk.rs	Wed May 04 18:17:44 2022 +0200
@@ -622,13 +622,18 @@
 
     let root_nodes = writer.write_nodes(dirstate_map.root.as_ref())?;
 
+    let unreachable_bytes = if append {
+        dirstate_map.unreachable_bytes
+    } else {
+        0
+    };
     let meta = TreeMetadata {
         root_nodes,
         nodes_with_entry_count: dirstate_map.nodes_with_entry_count.into(),
         nodes_with_copy_source_count: dirstate_map
             .nodes_with_copy_source_count
             .into(),
-        unreachable_bytes: dirstate_map.unreachable_bytes.into(),
+        unreachable_bytes: unreachable_bytes.into(),
         unused: [0; 4],
         ignore_patterns_hash: dirstate_map.ignore_patterns_hash,
     };