From c2f1eb2b5b32cf9b3ea761a4e17cbe649c49ca5e Mon Sep 17 00:00:00 2001 From: Harrison Cramer Date: Sun, 23 Apr 2023 19:02:37 -0400 Subject: [PATCH] Finally fixed commenting on deletions --- cmd/comment.go | 1 - lua/gitlab/comment.lua | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/comment.go b/cmd/comment.go index b7f129a..28fb904 100644 --- a/cmd/comment.go +++ b/cmd/comment.go @@ -189,7 +189,6 @@ func (c *Client) OverviewComment() 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) payload := &bytes.Buffer{} diff --git a/lua/gitlab/comment.lua b/lua/gitlab/comment.lua index ed42fc0..c027fa2 100644 --- a/lua/gitlab/comment.lua +++ b/lua/gitlab/comment.lua @@ -49,12 +49,14 @@ M.confirm_create_comment = function(text) local is_base_file = relative_file_path:find(".git") if is_base_file then -- We are looking at a deletion. local _, path = u.split_diff_view_filename(relative_file_path) + relative_file_path = path sha = M.find_deletion_commit(path) if sha == "" then return end end + print(relative_file_path) Job:new({ command = state.BIN,