Struct rustsec::repository::git::GitModificationTimes
source · pub struct GitModificationTimes { /* private fields */ }
Available on crate feature
osv-export
only.Expand description
Tracks the time of latest modification of files in git.
Implementations§
source§impl GitModificationTimes
impl GitModificationTimes
sourcepub fn new(repo: &Repository) -> Result<Self, Error>
pub fn new(repo: &Repository) -> Result<Self, Error>
Performance: collects all modification times on creation and caches them. This is more efficient for looking up lots of files, but wasteful if you just need to look up a couple files.
sourcepub fn for_path(&self, path: GitPath<'_>) -> &Time
pub fn for_path(&self, path: GitPath<'_>) -> &Time
Looks up the Git modification time for a given file path. The path must be relative to the root of the repository.
sourcepub fn mdate_for_path(&self, path: GitPath<'_>) -> Date
pub fn mdate_for_path(&self, path: GitPath<'_>) -> Date
Looks up the Git creation time for a given file path. The path must be relative to the root of the repository.
sourcepub fn cdate_for_path(&self, path: GitPath<'_>) -> Date
pub fn cdate_for_path(&self, path: GitPath<'_>) -> Date
Looks up the Git creation time for a given file path. The path must be relative to the root of the repository.