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

Error when checking breaking change against previous ref of current branch #419

Closed
chronitis opened this issue Aug 13, 2021 · 2 comments · Fixed by #421
Closed

Error when checking breaking change against previous ref of current branch #419

chronitis opened this issue Aug 13, 2021 · 2 comments · Fixed by #421

Comments

@chronitis
Copy link

chronitis commented Aug 13, 2021

This was encountered using buf-breaking-action (using the recommended syntax as of 0.4.0 for checking against a previous commit on the same branch), but can be replicated locally, so I suspect is a regression in buf, not the action.

When trying to check breaking changes against a previous revision of the current branch, as of 0.50.0 I get an error:

// on branch master
buf breaking --against 'https://github.com/org/repo.git#branch=master,ref=HEAD~1'
> Failure: could not clone https://github.com/org/repo.git: exit status 128
> fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository.

This also happens trying to refer to the same branch in the local repository:

buf breaking --against '.git#branch=master,ref=HEAD~1'
> Failure: could not clone file:///path/to/repo/.git: exit status 128
> fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository
> fatal: the remote end hung up unexpectedly.

Checking previous versions, this regression is first seen with 0.47.0; presumably due to

Rewrite the git cloner to use git init && git fetch rather than git clone. git clone is limited to local branches on the remote, whereas git fetch we can fetch any references on the remote including remote branches.

Git version 2.25.1, in case that is relevant.

@bufdev
Copy link
Member

bufdev commented Aug 13, 2021

This is fixed in #421. This will go out in the next release. Until then, you can use go get github.com/bufbuild/buf/cmd/buf@main. Thanks for the bug report!

@bufdev
Copy link
Member

bufdev commented Aug 13, 2021

This is released on v0.51.0.

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 a pull request may close this issue.

2 participants