MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / reopenIfReplaced

Method reopenIfReplaced

src/index.ts:381–384  ·  view source on GitHub ↗

* Heal a stale database handle in place. If `.codegraph/` was removed and * recreated at the SAME path while this instance held the DB open — a git * worktree removed and re-added, or `rm -rf .codegraph` + `codegraph init` — * our open fd points at the now-unlinked inode and can never see t

()

Source from the content-addressed store, hash-verified

379 * replaced file is still picked up — by that sync, or by the caller's retry.
380 */
381 reopenIfReplaced(): boolean {
382 if (this.indexMutex.isLocked()) return false;
383 return this.reopenReplacedDatabase();
384 }
385
386 /** The body of {@link reopenIfReplaced}, without the in-flight-sync guard. */
387 private reopenReplacedDatabase(): boolean {

Calls 2

isLockedMethod · 0.80

Tested by

no test coverage detected