MCPcopy Create free account
hub / github.com/AIScientists-Dev/Flowtrace / CommitLock

Class CommitLock

crates/flowtrace-cli/src/git.rs:22–24  ·  view source on GitHub ↗

Process-wide lock around any write to the underlying git repo. Why: under the single-repo layout, multiple trace folders share one outer `.git`. Two concurrent `trace` processes will both: (a) write `index.lock` at the same time (libgit2 returns `Locked`), and (b) race HEAD between `revparse` and `commit` (libgit2 returns "current tip is not the first parent"). libgit2's per-process index lock al

Source from the content-addressed store, hash-verified

20/// out of scope. Idempotent: re-entering from the same process serializes
21/// via the OS, which is what we want.
22struct CommitLock {
23 _file: std::fs::File,
24}
25
26impl CommitLock {
27 fn acquire(repo: &Repository) -> Result<Self> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…