Skip to content

Commit f34fbb9

Browse files
committed
Improved the remote check.
1 parent 20d560a commit f34fbb9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ export function getRemoteBranches() {
9696
export function isBranchPushedToRemote(branchName) {
9797
try {
9898
// Check if the branch exists on the remote
99-
execSync(`git ls-remote --heads origin ${branchName}`, { stdio: 'ignore' });
100-
return true;
99+
const output = execSync(`git ls-remote --heads origin ${branchName}`).toString().trim();
100+
// If output is empty, branch doesn't exist on remote
101+
return output.length > 0;
101102
} catch {
102103
return false;
103104
}

0 commit comments

Comments
 (0)