Add more detail to fork failure message

This commit is contained in:
Chris Roat 2024-01-23 07:28:05 -08:00 committed by William Martin
parent f015020bcd
commit 39215d9316

View file

@ -548,7 +548,7 @@ func ForkRepo(client *Client, repo ghrepo.Interface, org, newName string, defaul
// The GitHub API will happily return a HTTP 200 when attempting to fork own repo even though no forking // The GitHub API will happily return a HTTP 200 when attempting to fork own repo even though no forking
// actually took place. Ensure that we raise an error instead. // actually took place. Ensure that we raise an error instead.
if ghrepo.IsSame(repo, newRepo) { if ghrepo.IsSame(repo, newRepo) {
return newRepo, fmt.Errorf("%s cannot be forked", ghrepo.FullName(repo)) return newRepo, fmt.Errorf("%s cannot be forked to same owner or organization", ghrepo.FullName(repo))
} }
return newRepo, nil return newRepo, nil