MCPcopy Index your code
hub / github.com/changesets/changesets / getCurrentBranch

Function getCurrentBranch

packages/release-utils/src/gitUtils.ts:3–10  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

1import { execWithOutput } from "./utils";
2
3export const getCurrentBranch = async (cwd: string) => {
4 const { stdout } = await execWithOutput(
5 "git",
6 ["rev-parse", "--abbrev-ref", "HEAD"],
7 { cwd }
8 );
9 return stdout.trim();
10};
11
12export const pullBranch = async (branch: string, cwd: string) => {
13 await execWithOutput("git", ["pull", "origin", branch], { cwd });

Callers 1

setupRepoAndCloneFunction · 0.90

Calls 1

execWithOutputFunction · 0.90

Tested by 1

setupRepoAndCloneFunction · 0.72