Skip to content

Commit 385b9af

Browse files
Trims git output in conditional
1 parent 08a681d commit 385b9af

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
@@ -396,7 +396,13 @@ export class BranchesGitSubProvider implements GitBranchesSubProvider {
396396
// Cherry-pick detection (handles cherry-picks, rebases, etc)
397397
let data = await this.git.exec({ cwd: repoPath }, 'cherry', '--abbrev', '-v', into.name, branch.name);
398398
// Check if there are no lines or all lines startwith a `-` (i.e. likely merged)
399-
if (!data || data.split('\n').every(l => l.startsWith('-'))) {
399+
if (
400+
!data ||
401+
data
402+
.trim()
403+
.split('\n')
404+
.every(l => l.startsWith('-'))
405+
) {
400406
return { merged: true, confidence: 'high' };
401407
}
402408

0 commit comments

Comments
 (0)