MCPcopy
hub / github.com/21st-dev/1code / hasUpstreamBranch

Function hasUpstreamBranch

src/main/lib/git/git-operations.ts:21–30  ·  view source on GitHub ↗
(
	git: ReturnType<typeof simpleGit>,
)

Source from the content-addressed store, hash-verified

19export { isUpstreamMissingError };
20
21async function hasUpstreamBranch(
22 git: ReturnType<typeof simpleGit>,
23): Promise<boolean> {
24 try {
25 await git.raw(["rev-parse", "--abbrev-ref", "@{upstream}"]);
26 return true;
27 } catch {
28 return false;
29 }
30}
31
32/** Protected branches that should not be force-pushed to */
33const PROTECTED_BRANCHES = ["main", "master", "develop", "production", "staging"];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected