diff --git a/service/commit/commit.go b/service/commit/commit.go index 2f45a4ea..c313b3a5 100644 --- a/service/commit/commit.go +++ b/service/commit/commit.go @@ -16,6 +16,7 @@ package commit import ( "context" + "github.com/drone/drone/core" "github.com/drone/go-scm/scm" ) @@ -78,8 +79,8 @@ func (s *service) FindRef(ctx context.Context, user *core.User, repo, ref string }) switch s.client.Driver { - case scm.DriverBitbucket: - case scm.DriverStash: + case scm.DriverBitbucket, + scm.DriverStash: ref = scm.TrimRef(ref) branch, _, err := s.client.Git.FindBranch(ctx, repo, ref) // wont work for a Tag if err != nil {