Skip to content

Commit 71c23f7

Browse files
committed
trim ref when making API call to gitlab
1 parent b87006f commit 71c23f7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
### Fixed
9+
- Fix issue getting a GitLab commit by ref, from [@bradrydzewski](https://github.com/bradrydzewski).
10+
711
## [1.5.0]
812
### Added
913

scm/driver/gitlab/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (s *gitService) FindBranch(ctx context.Context, repo, name string) (*scm.Re
2424
}
2525

2626
func (s *gitService) FindCommit(ctx context.Context, repo, ref string) (*scm.Commit, *scm.Response, error) {
27-
path := fmt.Sprintf("api/v4/projects/%s/repository/commits/%s", encode(repo), ref)
27+
path := fmt.Sprintf("api/v4/projects/%s/repository/commits/%s", encode(repo), scm.TrimRef(ref))
2828
out := new(commit)
2929
res, err := s.client.do(ctx, "GET", path, nil, out)
3030
return convertCommit(out), res, err

0 commit comments

Comments
 (0)