Compute status for recording without scanning unrelated untracked files. Raw rename detection is the only record stage that consumes untracked entries. When it is enabled, defer the walk until the selected tracked status contains a deleted regular file. Untracked content hashes are also unnecessary because rename matching reads candidates on demand.
(
&self,
options: StatusOptions,
detect_raw_renames: bool,
)
| 39 | /// status contains a deleted regular file. Untracked content hashes are |
| 40 | /// also unnecessary because rename matching reads candidates on demand. |
| 41 | pub(crate) fn status_for_record( |
| 42 | &self, |
| 43 | options: StatusOptions, |
| 44 | detect_raw_renames: bool, |
| 45 | ) -> Result<RepositoryStatus, RepositoryError> { |
| 46 | let policy = if detect_raw_renames { |
| 47 | UntrackedScanPolicy::WhenRegularFileDeleted |
| 48 | } else { |
| 49 | UntrackedScanPolicy::Never |
| 50 | }; |
| 51 | self.status_inner(options, policy, false) |
| 52 | } |
| 53 | |
| 54 | fn status_inner( |
| 55 | &self, |