mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-15 02:58:11 +00:00
Rename
This commit is contained in:
parent
64dec560dc
commit
e279f0e904
@ -764,7 +764,7 @@ func (c *Comment) CodeCommentLink(ctx context.Context) string {
|
||||
return fmt.Sprintf("%s/files#%s", c.Issue.Link(), c.HashTag())
|
||||
}
|
||||
|
||||
func GetCodeCommentRef(prIndex, commentID int64) string {
|
||||
func GetCodeCommentRefName(prIndex, commentID int64) string {
|
||||
return fmt.Sprintf("refs/pull/%d/code-comment-%d", prIndex, commentID)
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ func DeleteComment(ctx context.Context, doer *user_model.User, comment *issues_m
|
||||
if err := comment.Issue.LoadPullRequest(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := git.RemoveRef(ctx, comment.Issue.Repo.RepoPath(), issues_model.GetCodeCommentRef(comment.Issue.PullRequest.Index, comment.ID)); err != nil {
|
||||
if err := git.RemoveRef(ctx, comment.Issue.Repo.RepoPath(), issues_model.GetCodeCommentRefName(comment.Issue.PullRequest.Index, comment.ID)); err != nil {
|
||||
log.Error("Unable to remove ref in base repository for PR[%d] Error: %v", comment.Issue.PullRequest.ID, err)
|
||||
// We should not return error here, because the comment has been removed from database.
|
||||
// users have to delete this ref manually or we should have a synchronize between
|
||||
|
@ -344,7 +344,7 @@ func deleteIssue(ctx context.Context, issue *issues_model.Issue) ([]string, erro
|
||||
}
|
||||
|
||||
if comment.ReviewID > 0 {
|
||||
if err := git.RemoveRef(ctx, issue.Repo.RepoPath(), issues_model.GetCodeCommentRef(issue.PullRequest.Index, comment.ID)); err != nil {
|
||||
if err := git.RemoveRef(ctx, issue.Repo.RepoPath(), issues_model.GetCodeCommentRefName(issue.PullRequest.Index, comment.ID)); err != nil {
|
||||
log.Error("Unable to remove ref in base repository for PR[%d] Error: %v", issue.PullRequest.ID, err)
|
||||
// We should not return error here, because the comment has been removed from database.
|
||||
// users have to delete this ref manually or we should have a synchronize between
|
||||
|
@ -289,8 +289,8 @@ func createCodeComment(ctx context.Context, doer *user_model.User, repo *repo_mo
|
||||
}
|
||||
|
||||
// The line commit ID Must be referenced in the git repository, because the branch maybe rebased or force-pushed.
|
||||
// If the review commit is GC, the position will not be calculated dynamically.
|
||||
if err := git.UpdateRef(ctx, pr.BaseRepo.RepoPath(), issues_model.GetCodeCommentRef(pr.Index, comment.ID), lineCommitID); err != nil {
|
||||
// If the review commit is GC, the position can not be calculated dynamically.
|
||||
if err := git.UpdateRef(ctx, pr.BaseRepo.RepoPath(), issues_model.GetCodeCommentRefName(pr.Index, comment.ID), lineCommitID); err != nil {
|
||||
log.Error("Unable to update ref in base repository for PR[%d] Error: %v", pr.ID, err)
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user