MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / is_tracked

Method is_tracked

atomic-repository/src/repository/tracking.rs:467–476  ·  view source on GitHub ↗

Check if a file is tracked. # Arguments `path` - Path to check # Example ```rust,ignore if repo.is_tracked("src/main.rs")? { println!("File is tracked"); } ```

(&self, path: P)

Source from the content-addressed store, hash-verified

465 /// }
466 /// ```
467 pub fn is_tracked<P: AsRef<Path>>(&self, path: P) -> Result<bool, RepositoryError> {
468 let normalized = normalize_path(path.as_ref());
469
470 let txn = self
471 .pristine
472 .read_txn()
473 .map_err(|e| RepositoryError::Database(e.to_string()))?;
474
475 is_tracked(&txn, &normalized).map_err(|e| RepositoryError::Database(e.to_string()))
476 }
477
478 /// Get the inode for a tracked file.
479 ///

Calls 4

is_trackedFunction · 0.85
as_refMethod · 0.80
read_txnMethod · 0.80
normalize_pathFunction · 0.50