(
&self,
working_copy: WorkingCopyId,
options: StatusOptions,
untracked_policy: UntrackedScanPolicy,
hash_untracked: bool,
change_source_override: Optio
| 68 | } |
| 69 | |
| 70 | fn status_inner( |
| 71 | &self, |
| 72 | working_copy: WorkingCopyId, |
| 73 | options: StatusOptions, |
| 74 | untracked_policy: UntrackedScanPolicy, |
| 75 | hash_untracked: bool, |
| 76 | change_source_override: Option<&dyn crate::change_source::ChangeSource>, |
| 77 | ) -> Result<RepositoryStatus, RepositoryError> { |
| 78 | let view_name = self.desired_view_name(working_copy)?; |
| 79 | let overall_start = std::time::Instant::now(); |
| 80 | |
| 81 | let txn = self |
| 82 | .pristine |
| 83 | .read_txn() |
| 84 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 85 | |
| 86 | let view = txn |
| 87 | .get_view(&view_name) |
| 88 | .map_err(|e| RepositoryError::Database(e.to_string()))? |
| 89 | .ok_or_else(|| RepositoryError::ViewNotFound { |
| 90 | name: view_name.clone(), |
| 91 | })?; |
| 92 | let visibility = graph_visibility_closure(&txn, &view)?; |
| 93 | let content_filter = crate::content_filter::GitAttributesFilter::for_repository(&self.root); |
| 94 | let git_colocated = self.root.join(".git").symlink_metadata().is_ok(); |
| 95 | // Native tracking keeps raw names, including escape-looking names. |
| 96 | // Imported Git identities need decoding only at filesystem boundaries; |
| 97 | // the SHA index covers the initial import before a checkpoint exists. |
| 98 | let decode_escaped_paths = git_colocated |
| 99 | && (self.shim_workspace_active()? |
| 100 | || !txn |
| 101 | .list_git_shas() |
| 102 | .map_err(|error| RepositoryError::Database(error.to_string()))? |
| 103 | .is_empty()); |
| 104 | let worktree_path = |path: &Path| { |
| 105 | if decode_escaped_paths { |
| 106 | tracked_worktree_path(path) |
| 107 | } else { |
| 108 | path.to_path_buf() |
| 109 | } |
| 110 | }; |
| 111 | let path_selected = |path: &Path| { |
| 112 | let path = worktree_path(path); |
| 113 | options.path_filters.is_empty() |
| 114 | || options |
| 115 | .path_filters |
| 116 | .iter() |
| 117 | .any(|filter| path.starts_with(filter) || filter.starts_with(&path)) |
| 118 | }; |
| 119 | |
| 120 | let projection = { |
| 121 | // Namespace projection resolves historical name/content spans for |
| 122 | // absent claims. Share the existing transaction-local span index |
| 123 | // instead of range-scanning a change's GRAPH for every lookup. |
| 124 | let cached_txn = atomic_core::pristine::CachedGraphTxn::new(&txn) |
| 125 | .map_err(|error| RepositoryError::Database(error.to_string()))?; |
| 126 | self.project_tree_for_visibility(&cached_txn, &visibility)? |
| 127 | }; |
no test coverage detected