cli/pkg/cmd/pr
majiayu000 9daa22ebac fix: error when head and base refs are identical in pr create
When a user runs `gh pr create` with head and base refs pointing to
the same ref in the same repository, the command now exits with an
error instead of proceeding with an invalid PR creation.

This prevents accidental pushes to the main branch and provides clear
feedback when users attempt to create a PR from the base branch.

Cross-repository PRs (e.g., from forks) with the same branch name
continue to work as expected.

Fixes #11903

Signed-off-by: majiayu000 <1835304752@qq.com>
2025-12-26 19:14:06 +08:00
..
checkout fix(pr checkout): add alias co 2025-09-24 14:56:59 +01:00
checks fix: --interval flags docs in gh pr checks 2025-10-30 20:06:45 +00:00
close Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
comment Add --delete-last option to pr comment and issue comment (#10596) 2025-05-01 14:12:55 +01:00
create fix: error when head and base refs are identical in pr create 2025-12-26 19:14:06 +08:00
diff Fix tests 2024-08-16 10:11:52 -07:00
edit Add test for non-interactive projects v1 unsupported 2025-10-21 19:09:14 -06:00
list fix(pr/shared): delegate query compilation to search package 2025-11-20 13:35:24 +00:00
merge test(pr merge): always assert stderr 2025-07-05 15:02:41 +01:00
ready Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
reopen Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
revert Return only basic pull request info when reverting a PR 2025-10-22 18:02:35 -04:00
review Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
shared refactor(pkg/search): rename KeywordsVerbatim to ImmutableKeywords 2025-11-20 16:53:16 +00:00
status Rework ref usage when finding and creating PRs 2025-04-15 13:38:10 -06:00
update-branch chore: remove redundant word in comment 2025-03-12 16:13:46 +08:00
view Update PR tests for v2 projects 2025-08-12 21:13:18 -04:00
pr.go feat: implement pr revert 2025-10-06 13:25:31 -04:00