Bugfix: Handle Merge Requests without Changes (#136)
This MR makes the plugin throw the correct error when someone tries to open up the reviewer without any changes
This commit is contained in:
committed by
GitHub
parent
cc68476b15
commit
d5038d63ca
@@ -16,6 +16,11 @@ M.open = function()
|
||||
return
|
||||
end
|
||||
|
||||
if diff_refs.base_sha == "" or diff_refs.head_sha == "" then
|
||||
u.notify("Merge request contains no changes", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command(string.format("DiffviewOpen %s..%s", diff_refs.base_sha, diff_refs.head_sha))
|
||||
M.tabnr = vim.api.nvim_get_current_tabpage()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user