Skip to content

Possible error with remotes when you want to checkout upstream PRs on Desktop #9593

Closed

Description

@ruggi99

Describe the bug

When I'm working with a fork, in my case with Desktop, and want to checkout upstream PRs, github-desktop-desktop remote is created even if upstream remote exists.

Version & OS

GitHub Desktop 5c0df17.
OS: Windows 10

Steps to reproduce the behavior

  1. Select a repository fork
  2. Checkout a PR (from upstream)
  3. se github-desktop-*** remote created

Expected behavior

No remote is created. Upstream remote used

Actual behavior

github-desktop-*** (github-desktop-desktop in my case) remote created as duplicate of upstream.

Screenshots

Add screenshots to help explain your problem, if applicable.

Logs

Attach your logs by opening the Help menu and selecting Show Logs..., if applicable.

Additional context

Think the problem is here:

const isRefInThisRepo =
head.gitHubRepository.cloneURL === gitHubRepository.cloneURL

Should be:

const isRefInThisRepo = gitHubRepository.fork ?
  head.gitHubRepository.cloneURL === gitHubRepository.parent!.cloneURL :
  head.gitHubRepository.cloneURL === gitHubRepository.cloneURL

This works in my case

Activity

  1. rafeca commented on Apr 22, 2020

    @rafeca
    Contributor

    Thanks for the report @ruggi99 !

    I actually recently created a PR that should address this issue: #9382 😄

  2. added
    bug
    priority-3
    on Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions