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
move
operation, which means that thefile_name
value is different from the existingfile_name
in the repo, we set the paraminfer
in 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
update
one:- If only the
file_name
param 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
content
param is passed we use the existingfile_name
in the repo as thefile_name
for the commit operation.
- If only the
Refs #219348 (closed)
Does this MR meet the acceptance criteria?
Conformity
Edited by Francisco Javier López