Misleading error message when creating a PR on an empty repo

Issue #13697 open
Ronald Chia
staff created an issue


Unable to create a PR within a repository which while it's main(forked) repository is an empty repository. Below are the error received: ForkedRepository.PNG

Steps to Reproduce

  1. Create an empty repository
  2. Fork the empty repository
  3. Add changes and branches on the Fork repository
  4. Navigate to Pull Request page to create PR
  5. Change the destination repository to the current repository (not the main(forked) repository)
  6. Click Create Pull Request

Expected Results

Able to create PR successfully as the Destination repository is the current repository with branches and commit instead of the empty main(forked) repository

Actual Results

After click Create pull request, the error below shows:

The following error(s) occurred saving this pull request
 - Can't create branch <Source Branch Name> since it already exists in <Current Repo Name>.


Add at least a commit in the forked repository