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

Remove duplicated code for scaffolding git repository #2559

Conversation

saquibmian
Copy link
Contributor

No description provided.

t.Logf("run %q", strings.Join(append([]string{cmd}, args...), " "))
_, err := io.Copy(os.Stderr, stderr)
require.NoError(t, err)
require.FailNow(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This improves the error message so that it's right in the test failures as opposed to stderr.

--- FAIL: TestCommitsToSyncWithNoPreviousSyncPoints (0.28s)
    gittest.go:204: 
                Error Trace:    /Users/saquib/dev/buf/private/pkg/git/gittest/gittest.go:204
                                                        /Users/saquib/dev/buf/private/pkg/git/gittest/repository.go:68
                                                        /Users/saquib/dev/buf/private/buf/bufsync/commits_to_sync_test.go:131
                                                        /Users/saquib/dev/buf/private/buf/bufsync/commits_to_sync_test.go:39
                Error:          git command failed: "git checkout bar": exit status 1
                Test:           TestCommitsToSyncWithNoPreviousSyncPoints
                Messages:       error: pathspec 'bar' did not match any file(s) known to git

Copy link
Member

@unmultimedio unmultimedio 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!!

@saquibmian saquibmian merged commit 91b4588 into main Nov 11, 2023
7 checks passed
@saquibmian saquibmian deleted the saquib/bsr-3029-change-scaffoldrepository-to-conditionally-create-empty branch November 11, 2023 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants