Store mtime + size + content hash for a batch of files in a single transaction. This populates the file index so that `status` can compare file metadata instead of reconstructing graph content for every file. Call this after git import (or any bulk write that puts files on disk without going through `record`). # Arguments `files` - Slice of `(path, mtime_secs, mtime_nanos, file_size, content_h
(
&self,
files: &[(String, i64, u32, u64, Hash)],
)
| 580 | /// * `files` - Slice of `(path, mtime_secs, mtime_nanos, file_size, content_hash)` tuples. |
| 581 | /// Paths should be repo-relative with forward slashes. |
| 582 | pub fn update_file_index( |
| 583 | &self, |
| 584 | files: &[(String, i64, u32, u64, Hash)], |
| 585 | ) -> Result<(), RepositoryError> { |
| 586 | if files.is_empty() { |
| 587 | return Ok(()); |
| 588 | } |
| 589 | |
| 590 | let mut txn = self |
| 591 | .pristine |
| 592 | .write_txn() |
| 593 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 594 | |
| 595 | for (path, secs, nanos, size, hash) in files { |
| 596 | txn.put_file_index(path, *secs, *nanos, *size, hash) |
| 597 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 598 | } |
| 599 | |
| 600 | txn.commit() |
| 601 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 602 | |
| 603 | Ok(()) |
| 604 | } |
| 605 | |
| 606 | /// Rebuild the FILE_INDEX from the current working copy. |
| 607 | /// |
no test coverage detected