MCPcopy Create free account
hub / github.com/continuedev/continue / getGitBranch

Function getGitBranch

extensions/cli/src/util/git.ts:29–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 * @returns The current branch name or null if not found
28 */
29export function getGitBranch(): string | null {
30 try {
31 const result = execSync("git branch --show-current", {
32 encoding: "utf-8",
33 cwd: process.cwd(),
34 stdio: "pipe",
35 });
36 return result.trim() || null;
37 } catch {
38 return null;
39 }
40}
41
42/**
43 * Check if current directory is a git repository

Callers 4

detectPrUrlFunction · 0.85
getRepoInfoFunction · 0.85
git.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected