Skip to content

Commit e279f0e

Browse files
committed
Rename
1 parent 64dec56 commit e279f0e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

models/issues/comment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ func (c *Comment) CodeCommentLink(ctx context.Context) string {
764764
return fmt.Sprintf("%s/files#%s", c.Issue.Link(), c.HashTag())
765765
}
766766

767-
func GetCodeCommentRef(prIndex, commentID int64) string {
767+
func GetCodeCommentRefName(prIndex, commentID int64) string {
768768
return fmt.Sprintf("refs/pull/%d/code-comment-%d", prIndex, commentID)
769769
}
770770

services/issue/comments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func DeleteComment(ctx context.Context, doer *user_model.User, comment *issues_m
159159
if err := comment.Issue.LoadPullRequest(ctx); err != nil {
160160
return err
161161
}
162-
if err := git.RemoveRef(ctx, comment.Issue.Repo.RepoPath(), issues_model.GetCodeCommentRef(comment.Issue.PullRequest.Index, comment.ID)); err != nil {
162+
if err := git.RemoveRef(ctx, comment.Issue.Repo.RepoPath(), issues_model.GetCodeCommentRefName(comment.Issue.PullRequest.Index, comment.ID)); err != nil {
163163
log.Error("Unable to remove ref in base repository for PR[%d] Error: %v", comment.Issue.PullRequest.ID, err)
164164
// We should not return error here, because the comment has been removed from database.
165165
// users have to delete this ref manually or we should have a synchronize between

services/issue/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ func deleteIssue(ctx context.Context, issue *issues_model.Issue) ([]string, erro
344344
}
345345

346346
if comment.ReviewID > 0 {
347-
if err := git.RemoveRef(ctx, issue.Repo.RepoPath(), issues_model.GetCodeCommentRef(issue.PullRequest.Index, comment.ID)); err != nil {
347+
if err := git.RemoveRef(ctx, issue.Repo.RepoPath(), issues_model.GetCodeCommentRefName(issue.PullRequest.Index, comment.ID)); err != nil {
348348
log.Error("Unable to remove ref in base repository for PR[%d] Error: %v", issue.PullRequest.ID, err)
349349
// We should not return error here, because the comment has been removed from database.
350350
// users have to delete this ref manually or we should have a synchronize between

services/pull/review.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ func createCodeComment(ctx context.Context, doer *user_model.User, repo *repo_mo
289289
}
290290

291291
// The line commit ID Must be referenced in the git repository, because the branch maybe rebased or force-pushed.
292-
// If the review commit is GC, the position will not be calculated dynamically.
293-
if err := git.UpdateRef(ctx, pr.BaseRepo.RepoPath(), issues_model.GetCodeCommentRef(pr.Index, comment.ID), lineCommitID); err != nil {
292+
// If the review commit is GC, the position can not be calculated dynamically.
293+
if err := git.UpdateRef(ctx, pr.BaseRepo.RepoPath(), issues_model.GetCodeCommentRefName(pr.Index, comment.ID), lineCommitID); err != nil {
294294
log.Error("Unable to update ref in base repository for PR[%d] Error: %v", pr.ID, err)
295295
return nil, err
296296
}

0 commit comments

Comments
 (0)