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

Function shadow_sync_active

atomic-cli/src/commands/git/shadow.rs:2090–2095  ·  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. NOTE: this marker is *retained* by `git shim disable` and by plain `atomic init` inside an existing Git checkout — it is not enrollment. Use [`shim_workspace_enrolled`] w

(git_repo: &GitRepository)

Source from the content-addressed store, hash-verified

2088/// `atomic init` inside an existing Git checkout — it is not enrollment. Use
2089/// [`shim_workspace_enrolled`] wherever the question is shim participation.
2090fn shadow_sync_active(git_repo: &GitRepository) -> bool {
2091 let exclude = git_repo.path().join("info").join("exclude");
2092 std::fs::read_to_string(exclude)
2093 .map(|c| c.lines().any(|l| l.trim() == "/.atomic/"))
2094 .unwrap_or(false)
2095}
2096
2097/// Whether the working copy at `root` participates in the colocated Git
2098/// shim: a verified checkpoint (written by an explicit shim command) or

Calls 2

pathMethod · 0.45
linesMethod · 0.45

Tested by

no test coverage detected