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

Function shadow_sync_active

atomic-cli/src/commands/git/shadow.rs:96–101  ·  view source on GitHub ↗

Whether git shadow sync is established for this repo (the `.git/info/exclude` carries Atomic's shadow patterns, written by import/push). Used to gate the view-switch git-follow so we never touch HEAD in a plain (non-shadow) repo.

(git_repo: &GitRepository)

Source from the content-addressed store, hash-verified

94/// carries Atomic's shadow patterns, written by import/push). Used to gate the
95/// view-switch git-follow so we never touch HEAD in a plain (non-shadow) repo.
96fn shadow_sync_active(git_repo: &GitRepository) -> bool {
97 let exclude = git_repo.path().join("info").join("exclude");
98 std::fs::read_to_string(exclude)
99 .map(|c| c.lines().any(|l| l.trim() == "/.atomic/"))
100 .unwrap_or(false)
101}
102
103/// Acquire the repo-scoped shadow-commit lock, or return `None` (a no-op skip)
104/// if a shadow materialize/commit is already in flight (SPEC §4.3 / Principle 5).

Callers 1

sync_git_head_to_viewFunction · 0.85

Calls 2

pathMethod · 0.45
linesMethod · 0.45

Tested by

no test coverage detected