Finally fixed commenting on deletions
This commit is contained in:
@@ -189,7 +189,6 @@ func (c *Client) OverviewComment() error {
|
|||||||
|
|
||||||
func (c *Client) CommentOnDeletion(lineNumber string, fileName string, comment string, diffVersionInfo MRVersion) error {
|
func (c *Client) CommentOnDeletion(lineNumber string, fileName string, comment string, diffVersionInfo MRVersion) error {
|
||||||
|
|
||||||
// https://gitlab.com/api/v4/projects/%s/merge_requests/%d/versions
|
|
||||||
deletionDiscussionUrl := fmt.Sprintf("https://gitlab.com/api/v4/projects/%s/merge_requests/%d/discussions", c.projectId, c.mergeId)
|
deletionDiscussionUrl := fmt.Sprintf("https://gitlab.com/api/v4/projects/%s/merge_requests/%d/discussions", c.projectId, c.mergeId)
|
||||||
|
|
||||||
payload := &bytes.Buffer{}
|
payload := &bytes.Buffer{}
|
||||||
|
|||||||
@@ -49,12 +49,14 @@ M.confirm_create_comment = function(text)
|
|||||||
local is_base_file = relative_file_path:find(".git")
|
local is_base_file = relative_file_path:find(".git")
|
||||||
if is_base_file then -- We are looking at a deletion.
|
if is_base_file then -- We are looking at a deletion.
|
||||||
local _, path = u.split_diff_view_filename(relative_file_path)
|
local _, path = u.split_diff_view_filename(relative_file_path)
|
||||||
|
relative_file_path = path
|
||||||
sha = M.find_deletion_commit(path)
|
sha = M.find_deletion_commit(path)
|
||||||
if sha == "" then
|
if sha == "" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
print(relative_file_path)
|
||||||
|
|
||||||
Job:new({
|
Job:new({
|
||||||
command = state.BIN,
|
command = state.BIN,
|
||||||
|
|||||||
Reference in New Issue
Block a user