Skip to content

Commit 8399ab4

Browse files
fix(server): a quoted pull request number counts as named by a merge command
`gh pr merge "19"`, and Codex's `/bin/zsh -lc "gh pr merge 19"`, named no pull request, so the merge silenced every watch on the thread instead of #19's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 68101f9 commit 8399ab4

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/server/src/sourceControl/sourceControlDefinitions.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ it.each([
2626

2727
it.each([
2828
["gh pr merge 19 --squash", [19]],
29+
['gh pr merge "19" --squash', [19]],
30+
['/bin/zsh -lc "gh pr merge 19"', [19]],
2931
["gh pr merge --squash --match-head-commit 3b2f958 #19", [19]],
3032
["gh pr close https://github.com/o/r/pull/19 && gh pr merge 20", [19, 20]],
3133
["glab mr merge https://gitlab.com/o/r/-/merge_requests/7", [7]],

‎apps/server/src/sourceControl/sourceControlDefinitions.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export const isChangeRequestCloseCommand = (command: string) =>
2626
(definition) => definition.changeRequestCloseCommand?.test(command) === true,
2727
);
2828

29-
const NAMED_CHANGE_REQUEST = /(?:^|[\s=])#?(\d+)(?=\s|$)|\/(?:pulls?|merge_requests)\/(\d+)/gu;
29+
// Quotes included, since Codex runs `/bin/zsh -lc "gh pr merge 19"`.
30+
const NAMED_CHANGE_REQUEST =
31+
/(?:^|[\s=])["']?#?(\d+)["']?(?=\s|$)|\/(?:pulls?|merge_requests)\/(\d+)/gu;
3032

3133
/**
3234
* The change request numbers a merge or close command names, or "any" when one names none, as a

0 commit comments

Comments
 (0)