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

Function classify_direction

atomic-cli/src/commands/git/shim.rs:747–763  ·  view source on GitHub ↗
(
    checkpoint_view: &str,
    checkpoint_git_head: &str,
    checkpoint_atomic_state: &str,
    current_git_branch: &str,
    current_git_head: &str,
    current_atomic_state: &str,
)

Source from the content-addressed store, hash-verified

745}
746
747fn classify_direction(
748 checkpoint_view: &str,
749 checkpoint_git_head: &str,
750 checkpoint_atomic_state: &str,
751 current_git_branch: &str,
752 current_git_head: &str,
753 current_atomic_state: &str,
754) -> ReconcileDirection {
755 let git_changed =
756 checkpoint_view != current_git_branch || checkpoint_git_head != current_git_head;
757 match (git_changed, checkpoint_atomic_state != current_atomic_state) {
758 (false, false) => ReconcileDirection::Neither,
759 (true, false) => ReconcileDirection::GitToAtomic,
760 (false, true) => ReconcileDirection::AtomicToGit,
761 (true, true) => ReconcileDirection::Diverged,
762 }
763}
764
765/// The repository root for a `hook-*` entry point, or `None` when Git ran
766/// the dispatcher inside a linked worktree and the hook passes through.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected