MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / temp_repo

Function temp_repo

src/daemon/git_watch/tests.rs:113–121  ·  view source on GitHub ↗

A bare temp git repo with one commit. Not indexed by tracedecay — these tests exercise the watcher's registration/debounce plumbing, which runs regardless of whether a store exists (a sync on a non-indexed project is a cheap no-op).

()

Source from the content-addressed store, hash-verified

111/// regardless of whether a store exists (a sync on a non-indexed project is
112/// a cheap no-op).
113fn temp_repo() -> tempfile::TempDir {
114 let dir = tempfile::tempdir().unwrap();
115 let root = dir.path();
116 git(root, &["init", "-b", "main"]);
117 std::fs::write(root.join("a.txt"), "hello\n").unwrap();
118 git(root, &["add", "."]);
119 git(root, &["commit", "-m", "init"]);
120 dir
121}
122
123async fn ready_registered_state(watcher: &GitWatcher, repo: &Path) -> Arc<WatchState> {
124 let canonical = repo.canonicalize().unwrap_or_else(|_| repo.to_path_buf());

Calls 2

writeFunction · 0.85
gitFunction · 0.70

Tested by

no test coverage detected