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

Unable to checkout pull request from unknown repository #182

Conversation

leandro-lucarella-sociomantic
Copy link
Contributor

Trying to checkout a pull request which was created by a user that was but is not longer part of the repositories organisation crashes git-hub. In this case Github will say that the pull requests repo is unknown repository

$ git hub pull checkout ID
Traceback (most recent call last):
  File "/usr/bin/git-hub", line 2043, in <module>
    main()
  File "/usr/bin/git-hub", line 2037, in main
    args.run(parser, args)
  File "/usr/bin/git-hub", line 621, in check_config_and_run
    cmd.run(parser, args)
  File "/usr/bin/git-hub", line 1464, in run
    remote_url = pull['head']['repo'][config.urltype]
TypeError: 'NoneType' object has no attribute '__getitem__'

It still possible to checkout the pull request by git fetch REMOTE pull/ID/head:BRANCHNAME

@mihails-strasuns-sociomantic

Is this still targeted for 0.10.2?

@leandro-lucarella-sociomantic
Copy link
Contributor

I'll have a quick look, if it's trivial I'll try to fix it, otherwise I'll move.

@leandro-lucarella-sociomantic
Copy link
Contributor

Mmm, is complicated to reproduce and it looks like a quite obscure case, I'll just move it.

@aspiers
Copy link

aspiers commented Mar 19, 2018

See also isaacs/github#168

@leandro-lucarella-sociomantic
Copy link
Contributor

We actually don't need that info, we can check out using the special ref pull/ID/head.

https://help.github.com/articles/checking-out-pull-requests-locally/

@leandro-lucarella-sociomantic
Copy link
Contributor

Oh, it was in the issue description 🤦‍♂️

We don't really need to have the "head" repo present to check out a PR,
we can use the special reference "pull/ID/head" instead.

https://help.github.com/articles/checking-out-pull-requests-locally/

Fixes sociomantic-tsunami#182.
@leandro-lucarella-sociomantic
Copy link
Contributor

Fix attached.

@mihails-strasuns-sociomantic mihails-strasuns-sociomantic merged commit 995b17a into sociomantic-tsunami:v1.0.x May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants