Skip to content

Commit 181ff40

Browse files
Trims git output in conditional
1 parent 9dbee67 commit 181ff40

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/env/node/git/sub-providers/branches.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,13 @@ export class BranchesGitSubProvider implements GitBranchesSubProvider {
448448
// Cherry-pick detection (handles cherry-picks, rebases, etc)
449449
let data = await this.git.exec({ cwd: repoPath }, 'cherry', '--abbrev', '-v', into.name, branch.name);
450450
// Check if there are no lines or all lines startwith a `-` (i.e. likely merged)
451-
if (!data || data.split('\n').every(l => l.startsWith('-'))) {
451+
if (
452+
!data ||
453+
data
454+
.trim()
455+
.split('\n')
456+
.every(l => l.startsWith('-'))
457+
) {
452458
return { merged: true, confidence: 'high' };
453459
}
454460

0 commit comments

Comments
 (0)