-
Notifications
You must be signed in to change notification settings - Fork 706
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. |
chris-laplante
added a commit
to chris-laplante/act
that referenced
this issue
Sep 25, 2023
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.
chris-laplante
added a commit
to chris-laplante/act
that referenced
this issue
Sep 25, 2023
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: