Miscellaneous Bug Fixes (#423)
fix: Show non-resolvable notes in winbar (#417) fix: add more emojis and make emoji picker configurable (#414) fix: comment creation should not be possible for renamed and moved files (#416) fix: color highlight groups are invalid (#421) fix: plugin failing to build on Windows (#419) --------- Co-authored-by: Jakub F. Bortlík <jakub.bortlik@proton.me>
This commit is contained in:
committed by
GitHub
parent
30daecfb60
commit
be027331e1
@@ -23,6 +23,7 @@ type LineRange struct {
|
||||
/* PositionData represents the position of a comment or note (relative to a file diff) */
|
||||
type PositionData struct {
|
||||
FileName string `json:"file_name"`
|
||||
OldFileName string `json:"old_file_name"`
|
||||
NewLine *int `json:"new_line,omitempty"`
|
||||
OldLine *int `json:"old_line,omitempty"`
|
||||
HeadCommitSHA string `json:"head_commit_sha"`
|
||||
@@ -41,13 +42,19 @@ type RequestWithPosition interface {
|
||||
func buildCommentPosition(commentWithPositionData RequestWithPosition) *gitlab.PositionOptions {
|
||||
positionData := commentWithPositionData.GetPositionData()
|
||||
|
||||
// If the file has been renamed, then this is a relevant part of the payload
|
||||
oldFileName := positionData.OldFileName
|
||||
if oldFileName == "" {
|
||||
oldFileName = positionData.FileName
|
||||
}
|
||||
|
||||
opt := &gitlab.PositionOptions{
|
||||
PositionType: &positionData.Type,
|
||||
StartSHA: &positionData.StartCommitSHA,
|
||||
HeadSHA: &positionData.HeadCommitSHA,
|
||||
BaseSHA: &positionData.BaseCommitSHA,
|
||||
NewPath: &positionData.FileName,
|
||||
OldPath: &positionData.FileName,
|
||||
OldPath: &oldFileName,
|
||||
NewLine: positionData.NewLine,
|
||||
OldLine: positionData.OldLine,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user