Fix bug in snippets updating only file_name or content
What does this MR do?
This MR fixes the bug referenced in #219348 (closed)
The problem is that when only file_name is passed the content used to the repository action is nil. The multi_action method uses this value as the new content instead of ignoring it.
We also discovered another edge case when only the content params is passed.
Therefore, this MRs implements the following:
- When the operation is a
moveoperation, which means that thefile_namevalue is different from the existingfile_namein the repo, we set the paraminferin the commit action. This is part of the rugged library and basically means that the operation has to use the existing content for the commit action. - When the operation is an
updateone:- If only the
file_nameparam is passed and its value is the same as the one in the repo, we don't commit anything since it's basically what that operation represents. - If only the
contentparam is passed we use the existingfile_namein the repo as thefile_namefor the commit operation.
- If only the
Refs #219348 (closed)
Does this MR meet the acceptance criteria?
Conformity
Edited by Francisco Javier López