Skip to content

Cloning gitlab URL results in GitHub repository being cloned. #4154

Closed

Description

@grokys

Description

If I try to clone a gitlab.com URL that also exists on github.com, the github.com URL will be cloned instead.

Version

GitHub Desktop version: 1.1.1-beta1
OS version: win10

Steps to Reproduce

  1. Go to File -> Clone Repository
  2. select the URL tab
  3. paste in https://gitlab.com/inkscape/inkscape.git
  4. Click Clone

Expected behavior: https://gitlab.com/inkscape/inkscape.git is cloned

Actual behavior: https://github.com/inkscape/inkscape.git is cloned

Reproduces how often: Every time afaics

Logs

2018-03-02T08:31:40.671Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune origin (took 1.099s)
2018-03-02T08:33:18.028Z - info: [ui] [AppStore.getAccountForRemoteURL] account found for remote: https://github.com/inkscape/inkscape.git - grokys (has token)
2018-03-02T08:35:03.033Z - info: [ui] Executing clone: git -c credential.helper= clone --recursive --progress -- https://github.com/inkscape/inkscape.git D:\projects\inkscape 

Activity

  1. shiftkey commented on Mar 2, 2018

    @shiftkey
    Member

    @grokys I wish I could say this was a elaborate joke but the actual issues is a bit more mundane.

    In here can you spot the missing context?

    Here's a hint:

      // extract a repository identifier
      const repositoryIdentifier = parseRepositoryIdentifier(urlOrRepositoryAlias)
      if (repositoryIdentifier) { 
        // wait, this doesn't contain the hostname!
        const { owner, name } = repositoryIdentifier
        // and inkscape/inkscape is a public repository on GitHub, oh no!
        const account = await findRepositoryAccount(allAccounts, owner, name)
        if (account) {
          // so you can go and clone this down anonymously if you're not signed in
          return account
        }
      }
    
      return null
  2. added
    bug
    on Mar 2, 2018
  3. self-assigned this
    on Jul 19, 2018
  4. added this to the 1.3.x milestone on Jul 19, 2018
  5. modified the milestones: 1.3.x, 1.3.4 on Aug 13, 2018
  6. modified the milestones: 1.3.5, 1.4.0 on Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions