Feat: Add and Remove Labels from an MR (#159)
This MR adds the ability to add or remove labels to a merge request. These labels are visible in the summary panel and are colored the same way as they would be in the Gitlab UI. This is a MINOR release.
This commit is contained in:
committed by
GitHub
parent
67f09e559a
commit
50e06ceff6
@@ -28,6 +28,16 @@ M.get_last_word = function(sentence, divider)
|
||||
return words[#words] or ""
|
||||
end
|
||||
|
||||
M.filter = function(input_table, value_to_remove)
|
||||
local resultTable = {}
|
||||
for _, v in ipairs(input_table) do
|
||||
if v ~= value_to_remove then
|
||||
table.insert(resultTable, v)
|
||||
end
|
||||
end
|
||||
return resultTable
|
||||
end
|
||||
|
||||
---Merges two deeply nested tables together, overriding values from the first with conflicts
|
||||
---@param defaults table The first table
|
||||
---@param overrides table The second table
|
||||
@@ -328,6 +338,22 @@ M.format_date = function(date_string)
|
||||
end
|
||||
end
|
||||
|
||||
M.difference = function(a, b)
|
||||
local set_b = {}
|
||||
for _, val in ipairs(b) do
|
||||
set_b[val] = true
|
||||
end
|
||||
|
||||
local not_included = {}
|
||||
for _, val in ipairs(a) do
|
||||
if not set_b[val] then
|
||||
table.insert(not_included, val)
|
||||
end
|
||||
end
|
||||
|
||||
return not_included
|
||||
end
|
||||
|
||||
M.jump_to_file = function(filename, line_number)
|
||||
if line_number == nil then
|
||||
line_number = 1
|
||||
@@ -637,6 +663,10 @@ M.get_icon = function(filename)
|
||||
end
|
||||
end
|
||||
|
||||
M.make_comma_separated_readable = function(str)
|
||||
return string.gsub(str, ",", ", ")
|
||||
end
|
||||
|
||||
---@param remote? boolean
|
||||
M.get_all_git_branches = function(remote)
|
||||
local branches = {}
|
||||
|
||||
Reference in New Issue
Block a user