-
Notifications
You must be signed in to change notification settings - Fork 723
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
go-git fails to parse branches with refs/pull
as their merge target
#530
Comments
This works fine: if err := r.Fetch(&git.FetchOptions{
RefSpecs: []config.RefSpec{"refs/pull/3741/head:suspend_asg_processes"},
Depth: 1,
}); err != nil {
fmt.Println("fetch err: ", err)
os.Exit(1)
} |
Lost context on this a long time ago, I hope this doesn't happen to anyone else bit if it does now there is a snippet :) I'll see if I get to testing this in my code :) |
It happened to me as well in the context of https://github.com/MichaelMure/git-bug, where I don't control the user git config, yet want to read or add values there. |
Thanks to go-git/go-git#530, act will spam the console/log with a billion warnings like this: WARN[0000] unable to get git repo: branch config: invalid merge when a GitHub PR branch is checked out.
Thanks to go-git/go-git#530, act will spam the console/log with a billion warnings like this: WARN[0000] unable to get git repo: branch config: invalid merge when a GitHub PR branch is checked out.
To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while. This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed. We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active. Thanks for your understanding and cooperation! |
guessing this commit should help with the issue, might come back to it (or @MichaelMure if the context is still fresh on your side) |
as a user of go-git, it seems the command https://pkg.go.dev/github.com/go-git/go-git/v5#Repository.ConfigScoped fails for
gh pr checkout
remote branches (from other users)tools used for test:
the issue stems from the fact that
refs/pull
is not a valid merge target, but is what cli/cli pushes.LOC that fails in go-git
go-git/plumbing/reference.go
Line 90 in 69aa78a
LOC that fails in my code https://github.com/georgettica/gogitmail/blob/38ccca86d8503101686497c63b21a48c71f81380/pkg/utils/utils.go#L24
I cannot check the error for the string there as it's an internal error
The text was updated successfully, but these errors were encountered: