diff options
author | Lanre Adelowo <adelowomailbox@gmail.com> | 2019-02-01 02:37:20 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-02-01 09:37:20 +0800 |
commit | f9d4bd53e6ace32593f273bb6a57158594f7f3ea (patch) | |
tree | ff228d28dd2d2f1e7f927d98c588ede633109053 /models | |
parent | 1219d46b027f027487bc0568a94baf2b95aeab28 (diff) | |
download | gitea-f9d4bd53e6ace32593f273bb6a57158594f7f3ea.tar.gz gitea-f9d4bd53e6ace32593f273bb6a57158594f7f3ea.zip |
support reviewing on a deleted file path (#5880)
Diffstat (limited to 'models')
-rw-r--r-- | models/issue_comment.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go index fb379fa941..05756c6cf2 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -873,10 +873,11 @@ func CreateCodeComment(doer *User, repo *Repository, issue *Issue, content, tree // No need for get commit for base branch changes if line > 0 { commit, err := gitRepo.LineBlame(pr.GetGitRefName(), gitRepo.Path, treePath, uint(line)) - if err != nil { + if err == nil { + commitID = commit.ID.String() + } else if err != nil && !strings.Contains(err.Error(), "exit status 128 - fatal: no such path") { return nil, fmt.Errorf("LineBlame[%s, %s, %s, %d]: %v", pr.GetGitRefName(), gitRepo.Path, treePath, line, err) } - commitID = commit.ID.String() } // Only fetch diff if comment is review comment |