For directories, do not consider the size as its invalid on remote.

This commit is contained in:
Klaas Freitag 2013-05-22 16:09:54 +02:00
parent 10437db2f9
commit 0764ef1620

View file

@ -135,6 +135,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
break; break;
} }
} else { } else {
bool is_equal_files;
/* /*
* file found on the other replica * file found on the other replica
*/ */
@ -155,7 +156,13 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
/* file on other replica is changed or new */ /* file on other replica is changed or new */
case CSYNC_INSTRUCTION_NEW: case CSYNC_INSTRUCTION_NEW:
case CSYNC_INSTRUCTION_EVAL: case CSYNC_INSTRUCTION_EVAL:
if (other->size == cur->size && other->modtime == cur->modtime) { if (other->type == CSYNC_VIO_FILE_TYPE_DIRECTORY &&
cur->type == CSYNC_VIO_FILE_TYPE_DIRECTORY) {
is_equal_files = (other->modtime == cur->modtime);
} else {
is_equal_files = ((other->size == cur->size) && (other->modtime == cur->modtime));
}
if (is_equal_files) {
/* The files are considered equal. */ /* The files are considered equal. */
cur->instruction = CSYNC_INSTRUCTION_NONE; cur->instruction = CSYNC_INSTRUCTION_NONE;
other->instruction = CSYNC_INSTRUCTION_NONE; other->instruction = CSYNC_INSTRUCTION_NONE;