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

Get remote url from config remote.[name].url #420

Merged
merged 1 commit into from
Jan 6, 2020
Merged

Get remote url from config remote.[name].url #420

merged 1 commit into from
Jan 6, 2020

Conversation

jsejcksn
Copy link
Contributor

Avoids "fatal: No such remote 'origin'" if remote does not exist (resolves #368)

This change modifies the remote url resolution behavior to use config remote.remoteName.url instead of remote get-url remoteName.

I created this PR using a docker container for VS Code because I can't install yarn on this development machine. In the container environment, when attempting to run/test the extension (following directions at Contributing > How to run), I got this error:

code --extensionDevelopmentPath=.
Ignoring option extensionDevelopmentPath: not supported for code.
At least one file or folder must be provided.

So I guess there's some sort of problem loading the VS Code extension host when developing in a container. Due to this error, I was not able to test the change, and will need someone to test it during code review.

The reproduction steps below describe the current behavior that this PR is intending to fix. This change should prevent step 3 from occurring.

    • create test directory
    • cd into directory
    • initiate new git repo
    • create test file
    • stage file
    • commit
    • launch vs code

    In a single terminal command:

    mkdir test \
      && cd test \
      && git init \
      && echo "hello world" > hello_world.txt \
      && git add . \
      && git commit -m "Initial commit" \
      && code .
  1. (In VS Code) Run in the command palette Git: View History (git log)

  2. The "Output" panel appears with the following lines at the end:

git remote get-url origin  (completed in 0.011s)
fatal: No such remote 'origin'

- Avoids "fatal: No such remote 'origin'" if remote does not exist
@ole1986
Copy link
Contributor

ole1986 commented Dec 29, 2019

I am pretty sure this will be resolved with PR #410, see here

Since git extension api does support reading the upstream info.

@jsejcksn
Copy link
Contributor Author

That’s excellent.

I don’t know the timeline on that PR (or if there are any blockers, etc.) but if it’s not going to be merged soon, perhaps this fix can be evaluated and merged in the meantime?

@jsejcksn
Copy link
Contributor Author

jsejcksn commented Jan 6, 2020

@ole1986 Thoughts?

@ole1986 ole1986 merged commit 99b6dbc into DonJayamanne:master Jan 6, 2020
@jsejcksn
Copy link
Contributor Author

jsejcksn commented Jan 6, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't complain, if there is no remote
2 participants