Skip to content

Fails to find issues and PRs correctly for active forks #867

@allejo

Description

@allejo

Describe the bug

When I clone a repo that is an active fork (one that has no intentions of being merged back in), any gh command will call commands relative to the original repo.

For example, I am working on westonruter/syntax-highlighting-code-block, which is a fork and has completely diverged from the original project. Any gh command here will try hit the original repo (mkaz/code-syntax-block) this repo was forked from.

$ gh --version
gh version 0.7.0 (2020-04-22)
https://github.com/cli/cli/releases/tag/v0.7.0

Steps to reproduce the behavior

$ gh repo clone westonruter/syntax-highlighting-code-block
$ cd syntax-highlighting-code-block
$ gh pr checkout 93
graphql error: 'Could not resolve to a PullRequest with the number of 93.'

This happens because mkaz/code-syntax-block does not have a PR 93 but westonruter/syntax-highlighting-code-block does, so this command should be valid.

Expected vs actual behavior

I expect that if I am cloning a forked repository, any issues or pull requests I list/create via gh should take that forked repository as the target and not the original repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions