diff options
Diffstat (limited to 'crates/git-tracker/src/tracker.rs')
| -rw-r--r-- | crates/git-tracker/src/tracker.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/git-tracker/src/tracker.rs b/crates/git-tracker/src/tracker.rs index e26f82d..e6a3f54 100644 --- a/crates/git-tracker/src/tracker.rs +++ b/crates/git-tracker/src/tracker.rs @@ -2,6 +2,11 @@ use std::path::Path; use git2::{Branch, BranchType, Commit, ErrorCode, Oid, Reference, Repository}; +/// Helper struct for tracking Git objects +pub struct Tracker { + repository: Repository, +} + #[derive(Debug, thiserror::Error)] pub enum Error { #[error("libgit2 error")] @@ -10,11 +15,6 @@ pub enum Error { RepositoryPathNotFound(String), } -/// Helper struct for tracking Git objects -pub struct Tracker { - repository: Repository, -} - impl Tracker { /// Create a new [`Tracker`] using the repository at [`path`] /// @@ -76,7 +76,7 @@ impl Tracker { .repository .graph_descendant_of(head.id(), commit.id())?; - Ok(has_commit || is_head) + Ok(is_head || has_commit) } /// Check if a [`Branch`] named [`branch_name`] has a commit with the SHA [`commit_sha`] |
