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

Function shadow_sync_active

atomic-cli/src/commands/git/shadow.rs:1902–1907  ·  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

1900/// `atomic init` inside an existing Git checkout — it is not enrollment. Use
1901/// [`shim_workspace_enrolled`] wherever the question is shim participation.
1902fn shadow_sync_active(git_repo: &GitRepository) -> bool {
1903 let exclude = git_repo.path().join("info").join("exclude");
1904 std::fs::read_to_string(exclude)
1905 .map(|c| c.lines().any(|l| l.trim() == "/.atomic/"))
1906 .unwrap_or(false)
1907}
1908
1909/// Whether the working copy at `root` participates in the colocated Git
1910/// shim: a verified checkpoint (written by an explicit shim command) or

Callers 5

verify_shim_publicationFunction · 0.85
sync_git_head_to_viewFunction · 0.85

Calls 2

pathMethod · 0.45
linesMethod · 0.45

Tested by

no test coverage detected