diff options
Diffstat (limited to 'services/repository/files/commit.go')
-rw-r--r-- | services/repository/files/commit.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/repository/files/commit.go b/services/repository/files/commit.go index bc5a4c8ed3..72e2279ae5 100644 --- a/services/repository/files/commit.go +++ b/services/repository/files/commit.go @@ -30,9 +30,12 @@ func CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, creato } defer closer.Close() - if _, err := gitRepo.GetCommit(sha); err != nil { + if commit, err := gitRepo.GetCommit(sha); err != nil { gitRepo.Close() return fmt.Errorf("GetCommit[%s]: %w", sha, err) + } else if len(sha) != git.SHAFullLength { + // use complete commit sha + sha = commit.ID.String() } gitRepo.Close() |