Skip to content

Commit 2ec70f5

Browse files
Copilotalexr00
andcommitted
fix: replace dashes and underscores with spaces in PR title generated from branch name
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 30dd740 commit 2ec70f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/github/createPRViewProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,8 @@ export class CreatePullRequestViewProvider extends BaseCreatePullRequestViewProv
724724

725725
const name = compareBranch.name;
726726
const branchNameTitle = (name: string) => {
727-
return `${name.charAt(0).toUpperCase()}${name.slice(1)}`;
727+
const nameWithSpaces = name.replace(/[-_]/g, ' ');
728+
return `${nameWithSpaces.charAt(0).toUpperCase()}${nameWithSpaces.slice(1)}`;
728729
};
729730

730731
// If branchName is selected, use the branch name as the title

0 commit comments

Comments
 (0)