Skip to content

Commit

Permalink
return different error message for get commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Aug 30, 2021
1 parent 28e86b5 commit 05e645c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/migrations/gitea_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error {
if !release.Draft {
commit, err := g.gitRepo.GetTagCommit(rel.TagName)
if err != nil {
return fmt.Errorf("GetCommit: %v", err)
return fmt.Errorf("GetTagCommit[%v]: %v", rel.TagName, err)
}
rel.NumCommits, err = commit.CommitsCount()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion services/pull/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func getMergeCommit(pr *models.PullRequest) (*git.Commit, error) {

commit, err := gitRepo.GetCommit(mergeCommit[:40])
if err != nil {
return nil, fmt.Errorf("GetCommit: %v", err)
return nil, fmt.Errorf("GetMergeCommit[%v]: %v", mergeCommit[:40], err)
}

return commit, nil
Expand Down
2 changes: 1 addition & 1 deletion services/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func createTag(gitRepo *git.Repository, rel *models.Release, msg string) (bool,

commit, err := gitRepo.GetCommit(rel.Target)
if err != nil {
return false, fmt.Errorf("GetCommit: %v", err)
return false, fmt.Errorf("createTag::GetCommit[%v]: %v", rel.Target, err)
}

// Trim '--' prefix to prevent command line argument vulnerability.
Expand Down

0 comments on commit 05e645c

Please sign in to comment.