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

Function same_dir

atomic-agent/src/transcript/opencode.rs:162–169  ·  view source on GitHub ↗

Compare two directories, canonicalizing when possible.

(a: &Path, b: &Path)

Source from the content-addressed store, hash-verified

160
161/// Compare two directories, canonicalizing when possible.
162fn same_dir(a: &Path, b: &Path) -> bool {
163 let ca = std::fs::canonicalize(a);
164 let cb = std::fs::canonicalize(b);
165 match (ca, cb) {
166 (Ok(ca), Ok(cb)) => ca == cb,
167 _ => a == b,
168 }
169}
170
171/// Messages of the session in chronological order: `(id, role)`.
172fn read_messages(conn: &Connection, session_id: &str) -> Option<Vec<(String, String)>> {

Callers 1

read_turnFunction · 0.85

Calls 1

canonicalizeFunction · 0.85

Tested by

no test coverage detected