MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / currentBranch

Method currentBranch

src/agent/git-sandbox.ts:124–128  ·  view source on GitHub ↗

Current branch name, or null if detached/unknown.

(signal?: AbortSignal)

Source from the content-addressed store, hash-verified

122
123 /** Current branch name, or null if detached/unknown. */
124 private async currentBranch(signal?: AbortSignal): Promise<string | null> {
125 const r = await git(['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: this.cwd, signal });
126 const name = r.stdout.trim();
127 return (r.exitCode === 0) && name && name !== 'HEAD' ? name : null;
128 }
129
130 private async headSha(signal?: AbortSignal): Promise<string | null> {
131 const r = await git(['rev-parse', 'HEAD'], { cwd: this.cwd, signal });

Callers 4

beginMethod · 0.95
checkpointMethod · 0.95
backtrackMethod · 0.95
finishMethod · 0.95

Calls 1

gitFunction · 0.50

Tested by

no test coverage detected