Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 4f16caa

Browse files
committed
MINOR: improve error reporting, use gitlab commit SHA instead of ref
1 parent bdf7089 commit 4f16caa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

check-commit/check.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func readGitEnvironment() (*gitEnv, error) {
205205
knownVars := []gitEnvVars{
206206
{"Github", "GITHUB_REF", "GITHUB_BASE_REF"},
207207
{"Gitlab", "CI_MERGE_REQUEST_SOURCE_BRANCH_NAME", "CI_MERGE_REQUEST_TARGET_BRANCH_NAME"},
208-
{"Gitlab-commit", "CI_COMMIT_REF_NAME", "CI_DEFAULT_BRANCH"},
208+
{"Gitlab-commit", "CI_COMMIT_SHA", "CI_DEFAULT_BRANCH"},
209209
}
210210

211211
var ref, base string
@@ -258,7 +258,7 @@ func getCommitSubjects(repo *git.Repository, from, to string) ([]string, error)
258258
for _, refString := range refStrings {
259259
hash, err := repo.ResolveRevision(plumbing.Revision(refString))
260260
if err != nil {
261-
log.Fatalf("unable to resolve revision %s to hash", refString)
261+
log.Fatalf("unable to resolve revision %s to hash: %s", refString, err)
262262
}
263263

264264
hashes = append(hashes, hash)

0 commit comments

Comments
 (0)