fix: error when head and base refs are identical in pr create by majiayu000 · Pull Request #12376 · cli/cli
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 cli#11903 Signed-off-by: majiayu000 <1835304752@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters