Bugfix: Merge Function
Previously, the merge function would override the entire default table during a merge if a matching table was found in the override table. This would prevent users from modifying a single setting (for instance changing just a single icon, rather than the whole thing)
This commit is contained in:
@@ -116,9 +116,9 @@ end
|
||||
-- for each of the actions to occur. This is necessary because some Gitlab behaviors (like
|
||||
-- adding a reviewer) requires some initial state.
|
||||
M.dependencies = {
|
||||
info = { endpoint = "/info", key = "info", state = "INFO" },
|
||||
revisions = { endpoint = "/mr/revisions", key = "Revisions", state = "MR_REVISIONS" },
|
||||
project_members = { endpoint = "/members", key = "ProjectMembers", state = "PROJECT_MEMBERS" }
|
||||
info = { endpoint = "/info", key = "info", state = "INFO", refresh = false },
|
||||
revisions = { endpoint = "/mr/revisions", key = "Revisions", state = "MR_REVISIONS", refresh = false },
|
||||
project_members = { endpoint = "/members", key = "ProjectMembers", state = "PROJECT_MEMBERS", refresh = false }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -114,14 +114,6 @@ M.merge = function(defaults, overrides)
|
||||
end
|
||||
end
|
||||
|
||||
for key, value in pairs(overrides) do
|
||||
if type(value) == "table" then
|
||||
result[key] = M.merge(value, overrides[key] or {})
|
||||
else
|
||||
result[key] = overrides[key] or value
|
||||
end
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user