first pass of merging in warp (doesn't build)

This commit is contained in:
Ryan Ward
2026-07-01 16:08:58 -05:00
parent 2f64909469
commit 4770ac06b5
3662 changed files with 414574 additions and 89772 deletions
@@ -1,12 +1,13 @@
use crate::file_tree_store::FileTreeEntry;
use crate::file_tree_store::{FileTreeDirectoryEntryState, FileTreeEntryState};
use crate::{BuildTreeError, DirectoryEntry, Entry};
use galaxy_util::standardized_path::StandardizedPath;
use ignore::gitignore::Gitignore;
use std::collections::{HashMap, HashSet};
use std::iter;
use std::sync::Arc;
use ignore::gitignore::Gitignore;
use galaxy_util::standardized_path::StandardizedPath;
use crate::file_tree_store::{FileTreeDirectoryEntryState, FileTreeEntry, FileTreeEntryState};
use crate::{BuildTreeError, DirectoryEntry, Entry};
#[derive(Debug, Clone)]
pub(super) struct FileTreeMapStore {
state_map: HashMap<Arc<StandardizedPath>, FileTreeEntryState>,
@@ -202,9 +203,14 @@ impl FileTreeMapStore {
pub fn insert_entry_at_path(&mut self, path: Arc<StandardizedPath>, entry: Entry) {
let child_entry_map = FileTreeEntry::from(entry);
self.state_map.extend(child_entry_map.state_map.state_map);
// The child was just constructed, so its `Arc` is unique and
// `try_unwrap` avoids a clone; fall back to cloning only if it is
// somehow shared.
let child_store =
Arc::try_unwrap(child_entry_map.state_map).unwrap_or_else(|arc| (*arc).clone());
self.state_map.extend(child_store.state_map);
self.parent_to_child_map
.extend(child_entry_map.state_map.parent_to_child_map);
.extend(child_store.parent_to_child_map);
// ATODO test this
if let Some(parent) = self.parent_directory(&path) {