MCPcopy Create free account
hub / github.com/SethGammon/Citadel / resolveGitRef

Function resolveGitRef

scripts/stack-plan.js:122–133  ·  view source on GitHub ↗
(projectRoot, ref)

Source from the content-addressed store, hash-verified

120}
121
122function resolveGitRef(projectRoot, ref) {
123 if (!ref) return null;
124 try {
125 return childProcess.execFileSync('git', ['rev-parse', '--verify', ref], {
126 cwd: projectRoot,
127 encoding: 'utf8',
128 stdio: ['ignore', 'pipe', 'ignore'],
129 }).trim().slice(0, 7);
130 } catch {
131 return null;
132 }
133}
134
135function currentBranchHead(projectRoot, branch, options = {}) {
136 if (!branch) return null;

Callers 1

currentBranchHeadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected