MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / hasBranch

Function hasBranch

Extension/translations_auto_pr.js:42–52  ·  view source on GitHub ↗
(branchName)

Source from the content-addressed store, hash-verified

40console.log(`locSubPath=${locSubPath}`);
41
42function hasBranch(branchName) {
43 console.log(`Checking for existence of branch "${branchName}" (git branch --list ${branchName})`);
44 let output = cp.execSync(`git branch --list ${branchName}`);
45 let lines = output.toString().split("\n");
46 let found = false;
47 lines.forEach(line => {
48 found = found || (line === ` ${branchName}`);
49 });
50
51 return found;
52}
53
54function hasAnyChanges() {
55 console.log("Checking if any files have changed (git status --porcelain)");

Callers 1

Calls 2

toStringMethod · 0.80
forEachMethod · 0.45

Tested by

no test coverage detected