# HG changeset patch # User Olaf Wintermann # Date 1555837576 -7200 # Node ID 7fb81fd429b2fdde03b6de3c6a01a0b7b966cec4 # Parent ec0ec7908b7da4b26a5982d64df500f43835bf12 fix that knowledge about resource existence was fucked up by versioning_begin diff -r ec0ec7908b7d -r 7fb81fd429b2 dav/sync.c --- a/dav/sync.c Sun Apr 21 10:53:21 2019 +0200 +++ b/dav/sync.c Sun Apr 21 11:06:16 2019 +0200 @@ -3140,7 +3140,7 @@ #define VBEGIN_ERROR_MOVE 2 #define VBEGIN_ERROR_PROPPATCH 3 #define VBEGIN_ERROR_CHECKOUT 4 -int versioning_begin(SyncDirectory *dir, DavResource *res) { +int versioning_begin(SyncDirectory *dir, DavResource *res, int *exists) { int ret = 0; if(dir->versioning->type == VERSIONING_SIMPLE && res->exists) { @@ -3209,6 +3209,10 @@ ret = VBEGIN_ERROR_MOVE; break; } + } else { + // tell the caller the resource does not exist anymore at + // the original location + *exists = 0; } } @@ -3592,7 +3596,7 @@ // and sets res->exists int exists = res->exists; if(dir->versioning && dir->versioning->always && !issplit) { - int err = versioning_begin(dir, res); + int err = versioning_begin(dir, res, &exists); if(err) { fprintf(stderr, "Cannot store version for resource: %s\n", res->href); free(local_path);