Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Ignores Organization and uses username instead #697

Closed
josemvidal opened this issue Oct 10, 2019 · 4 comments
Closed

Ignores Organization and uses username instead #697

josemvidal opened this issue Oct 10, 2019 · 4 comments
Assignees

Comments

@josemvidal
Copy link

Version number

> gh --version
gh 2.1.0

Describe the bug
After upgrading, commands inside a repo that belongs to a Github org will try to access the same repo under my username. For example:

> cat .git/config                                                                   
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
	precomposeunicode = true
[remote "origin"]
	url = [email protected]:SCCapstone/AddMe.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
 ~/ca/re/AddMe   master
> gh is                                                                                  
Listing open issues on josemvidal/AddMe
Error: Error listing issues
HttpError: Not Found
    at Object.run (/usr/local/lib/node_modules/gh/lib/cmds/issue.js:135:19)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)

In the above, the repo belongs at SCCapstone/AddMe, but gh tries to use josemvidal/AddMe and fails, since that is the wrong repo.

BTW, git pull works in this repo.

The repo is private.

This used to work fine a few months back.

To Reproduce

  1. Clone repo from an Org
  2. gh is

Expected behavior

No error message.

@josemvidal josemvidal added the bug label Oct 10, 2019
protoEvangelion pushed a commit to protoEvangelion/gh that referenced this issue Oct 11, 2019
This was caused in cmd because we were checking a mutated repo arg
rather than the original repo arg to compute the user.

fix node-gh#697
@protoEvangelion
Copy link
Member

Thanks for the thorough bug report @josemvidal ! Working on it now 😄

@protoEvangelion protoEvangelion self-assigned this Oct 11, 2019
protoEvangelion pushed a commit that referenced this issue Oct 11, 2019
## [2.1.1](v2.1.0...v2.1.1) (2019-10-11)

### Bug Fixes

* **issue:** ensure user is based on git remote ([8b0b637](8b0b637)), closes [#697](#697)
@protoEvangelion
Copy link
Member

🎉 This issue has been resolved in version 2.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@protoEvangelion
Copy link
Member

@all-contributors please add @josemvidal to list of contributors for reporting bug

@allcontributors
Copy link
Contributor

@protoEvangelion

I've put up a pull request to add @josemvidal! 🎉

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

No branches or pull requests

2 participants