Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(clone): provide helpful message when fork conflicts cause an error #139

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/clone/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func run(c *cobra.Command, _ []string) {
err = g.Pull(pullFromUpstreamActivity.Writer(), repoDirPath, "upstream", defaultBranch)
if err != nil {
pullFromUpstreamActivity.EndWithFailure(err)
logger.Printf("\nWe weren't able to pull the latest upstream changes into your fork of %s. This is probably because you have a pre-existing fork with commits ahead of upstream. Please change this or delete your fork, and try again.\n", repo.FullRepoName)
errorCount++
continue
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/clone/clone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ func TestItLogsPullErrorsButContinuesToTryAll(t *testing.T) {
assert.NoError(t, err)
assert.Contains(t, out, "Pulling latest changes from org1/repo1")
assert.Contains(t, out, "Pulling latest changes from org2/repo2")
assert.Contains(t, out, "We weren't able to pull the latest upstream changes into your fork of org1/repo1")
assert.Contains(t, out, "We weren't able to pull the latest upstream changes into your fork of org2/repo2")
assert.Contains(t, out, "turbolift clone completed with errors")
assert.Contains(t, out, "2 repos errored")

Expand Down
Loading