Fix renaming if the other file already exist on the server.

In that case, we have a conflict.  Handle it the same ways as for new
files.
This commit is contained in:
Olivier Goffart 2012-12-12 13:53:19 +01:00
parent 4e8ff9ae05
commit 10965eaa98

View File

@ -130,6 +130,11 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
other = (csync_file_stat_t *) node->data;
switch (cur->instruction) {
case CSYNC_INSTRUCTION_RENAME:
/* If the file already exist on the other side, we have a conflict.
Abort the rename and consider it is a new file. */
cur->instruction = CSYNC_INSTRUCTION_NEW;
/* fall trough */
/* file on current replica is new */
case CSYNC_INSTRUCTION_NEW:
switch (other->instruction) {