Repository navigation
gh fails on a Repo that was moved or renamed #345
Description
Activity
- addedbugSomething isn't workingSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
on Feb 10, 2020 This exact same behavior also occurs for repos that were renamed.
Reacted by Tiernan L- changed the title
[-]gh fails on a Repo that was moved[/-][+]gh fails on a Repo that was moved or renamed[/+]on Feb 10, 2020 - I tested the repo move bug and I could not reproduce this. Note: my repo and org were public and both mine, if it matters.
Here are my logs while testing on v0.5.4:
➜ tests git:(master) ✗ git clone https://github.com/tierninho/sdsdsdffsd ➜ tests git:(master) ✗ cd sdsdsdffsd ➜ sdsdsdffsd git:(master) gh pr list Pull requests for tierninho/sdsdsdffsd #1 sdfsdf tierninho-patch-1 ➜ sdsdsdffsd git:(master) gh issue list Issues for tierninho/sdsdsdffsd #2 sdfsd ➜ sdsdsdffsd git:(master) git remote -v origin https://github.com/tierninho/sdsdsdffsd (fetch) origin https://github.com/tierninho/sdsdsdffsd (push) ➜ sdsdsdffsd git:(master) gh pr list Pull requests for tierninho/sdsdsdffsd #1 sdfsdf tierninho-patch-1 ➜ sdsdsdffsd git:(master) gh issue list Issues for tierninho/sdsdsdffsd #2 sdfsd ➜ sdsdsdffsd git:(master) git remote -v origin https://github.com/tierninho/sdsdsdffsd (fetch) origin https://github.com/tierninho/sdsdsdffsd (push)I could also verify the data in the newly transferred repo once I
cdinto that direcotry. Should we even be allowing access to data in the "old" repo if it is transferred to another org?
- As for the renamed repo, I had no issues either and my logs were similar.
In fact, now seeing yout check I also created a new repo and did these checks:
- Renamed the repo;
- Transfered ownership to another org
ghworked in every step, even using the original remote url.But still, I have this repo (https://github.com/b2wdigital/async-worker) that used to belong to
b2w-bitorg (https://github.com/B2W-BIT) and now belongs tob2wdigitalorg (https://github.com/b2wdigital). If I point the remote to the old orgghfails. If I change to the newghworks. Don't know why.The only difference is that when we changed this project from one org to the other we didn't transfered ownership we renamed the whole org.
I will try do do more checks to see if I can find anything.
With a fresh new clone I was able to reproduce the problem. Note: I cloned the project using the old URL.
> git clone github.com:b2w-bit/async-worker Cloning into 'async-worker'... remote: Enumerating objects: 315, done. remote: Counting objects: 100% (315/315), done. remote: Compressing objects: 100% (182/182), done. remote: Total 5102 (delta 165), reused 249 (delta 119), pack-reused 4787 Receiving objects: 100% (5102/5102), 2.36 MiB | 3.40 MiB/s, done. Resolving deltas: 100% (3332/3332), done. > cd async-worker > gh pr list Pull requests for b2w-bit/async-worker graphql error: 'Could not resolve to a Repository with the name 'async-worker'.' > git remote -v origin github.com:b2w-bit/async-worker (fetch) origin github.com:b2w-bit/async-worker (push) > git remote set-url origin github.com:b2wdigital/async-worker > gh pr list Pull requests for b2wdigital/async-worker #154 Enabling new parameters from aioamqp dmvieira:feature/adding-new-parameters-from-aioamqp #153 Adding code of conduct and contributing dmvieira:feature/contributing #151 Generate HTML Docs feature/new-docs-html-generated #150 Feature/sphinx docs structure feature/sphinx-docs-structureMaybe this could be a good starting point to debug the code. The project is public so if anyone could try this too.
Note: The same behavior happens when clonning via https.
Thanks,
- removedbugSomething isn't workingSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
on Feb 11, 2020 @daltonmatos thanks for the update on this. I can reproduce this, however I believe the results are expected and this is not a bug.
Anytime you rename an org means you have to update your local repos to the new location, as outlined in the warning ahead of making the change:
I could not break the flow until I decided to rename the org.
Steps were:
- Clone repo under an org
- Verify
gh issue listworks - Rename Org on Github.com
- Verify
gh issue listerrors out (as expected) - Update remote in terminal
- Verify
gh issue listworks
Happy to look into this further. Until then removing the
buglabel and closing the issue.Sure. Thanks.

Describe the bug
I have a repository that was moved from one organization to another. The remote
originwas still pointing to the old org, which works transparently when pushing and pulling code.ghfails recognize that the repository has moved.Steps to reproduce the behavior
gh pr liston this cloned code (cloned before the move)graphql error: 'Could not resolve to a Repository with the name '<repo-name>'.'Expected vs actual behavior
Expected the PR to be listed.
Logs
Here is an example of this behavior. After changing the remote URL
ghworked.