Skip to content

Add check to see if current owner is attempting to fork the repo#5794

Merged
mislav merged 9 commits intocli:trunkfrom
jf-delineate:trunk
Jun 14, 2022
Merged

Add check to see if current owner is attempting to fork the repo#5794
mislav merged 9 commits intocli:trunkfrom
jf-delineate:trunk

Conversation

@jf-delineate
Copy link
Copy Markdown
Contributor

This PR adds a check after the call to the API to fork a repo to check if the repo to fork is the same as the forked repo data object that is returned. If the full name OWNER/REPO are equal then an error is returned to indicate this is not possible.

Fixes #4560

@jf-delineate jf-delineate requested a review from a team as a code owner June 11, 2022 12:42
@jf-delineate jf-delineate requested review from samcoe and removed request for a team June 11, 2022 12:42
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Jun 11, 2022
@samcoe samcoe self-assigned this Jun 13, 2022
Copy link
Copy Markdown
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on! This looks good; I would just like to see the logic implemented in a different place please.

Comment thread pkg/cmd/repo/fork/fork.go Outdated
Comment thread pkg/cmd/repo/fork/fork.go Outdated
Comment thread pkg/cmd/repo/fork/fork.go Outdated
Copy link
Copy Markdown
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mislav mislav enabled auto-merge (squash) June 14, 2022 11:50
@mislav mislav merged commit ddb408e into cli:trunk Jun 14, 2022
@pjgoodall
Copy link
Copy Markdown

Thank-you all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'gh repo fork' fails to provide useful warning about forking own repository

5 participants