go-gitlab-client icon indicating copy to clipboard operation
go-gitlab-client copied to clipboard

CommitRef struct is wrong

Open edison-moreland opened this issue 5 years ago • 0 comments

First off, this project has been a life saver! I started writing something similar for my small project but that started getting too big. I ran into a bit of an issue try to get commit refs

According to the docs the response from GET /projects/:id/repository/commits/:sha/refs looks like this:

[
  {"type": "branch", "name": "'test'"},
  {"type": "branch", "name": "add-balsamiq-file"},
  {"type": "branch", "name": "wip"},
  {"type": "tag", "name": "v1.1.0"}
]

Which is not the same as CommitRef{} :

type CommitRef struct {
	Id   string `json:"id" yaml:"id"`
	Sha  string `json:"sha" yaml:"sha"`
	Type string `json:"type" yaml:"type"`
}

I'd be happy to make a pull request with an accurate struct. Thanks! :)

edison-moreland avatar Nov 01 '19 23:11 edison-moreland