Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git API shows incorrect remote when there's an extra push url #133727

Open
alexr00 opened this issue Sep 24, 2021 · 0 comments
Open

Git API shows incorrect remote when there's an extra push url #133727

alexr00 opened this issue Sep 24, 2021 · 0 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Milestone

Comments

@alexr00
Copy link
Member

alexr00 commented Sep 24, 2021

Found while trying to fix microsoft/vscode-pull-request-github#2891

The setup:

  1. Have a folder with a basic git setup with github remotes, like this:
PS D:\repos\alexr00\playground> git remote -v
origin  https://github.com/alexr00/playground.git (fetch)
origin  https://github.com/alexr00/playground.git (push)
  1. Add another push remote:
PS D:\repos\alexr00\playground> git remote set-url --add origin "file:///C:\Users\alros\extraRemote"
PS D:\repos\alexr00\playground> git remote -v
origin  https://github.com/alexr00/playground.git (fetch)
origin  https://github.com/alexr00/playground.git (push)
origin  file:///C:\Users\alros\extraRemote (push)
  1. Now, use the git extension API to get the remotes for this repository.
  2. The git extension API specifically has a separate fetch and push url:
    readonly fetchUrl?: string;
    readonly pushUrl?: string;

    So I would expect those to reflect the results of git remote -v: the fetch url should be the github url, and the push url should be one of the push urls.
    In practice, both fetchUrl and pushUrl are the file url.
@eamodio eamodio assigned lszomoru and unassigned eamodio Oct 7, 2021
@eamodio eamodio added git GIT issues bug Issue identified by VS Code Team member as probable bug labels Oct 7, 2021
@eamodio eamodio added this to the Backlog milestone Oct 7, 2021
@lszomoru lszomoru modified the milestones: Backlog, January 2022 Jan 4, 2022
@lszomoru lszomoru modified the milestones: January 2022, February 2022 Jan 27, 2022
@lszomoru lszomoru modified the milestones: February 2022, March 2022 Feb 24, 2022
@lszomoru lszomoru modified the milestones: March 2022, April 2022 Mar 21, 2022
@joaomoreno joaomoreno modified the milestones: April 2022, Backlog Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Projects
None yet
Development

No branches or pull requests

4 participants