mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 11:48:56 +03:00
Make sure the directory after a rename has a md5
If not when we do a read from db later, the updater will beleive the directory is no longer on the server
This commit is contained in:
parent
73ef2c1b6f
commit
68a427d7e4
1 changed files with 6 additions and 6 deletions
|
@ -798,7 +798,6 @@ static int _csync_rename_file(CSYNC *ctx, csync_file_stat_t *st) {
|
|||
struct timeval times[2];
|
||||
char *suri = NULL;
|
||||
char *duri = NULL;
|
||||
const char *tmd5 = NULL;
|
||||
c_rbnode_t *node = NULL;
|
||||
char *tdir = NULL;
|
||||
csync_file_stat_t *other = NULL;
|
||||
|
@ -900,14 +899,15 @@ static int _csync_rename_file(CSYNC *ctx, csync_file_stat_t *st) {
|
|||
|
||||
}
|
||||
|
||||
/* The the uniq ID for the destination */
|
||||
if (st->type != CSYNC_FTW_TYPE_DIR)
|
||||
tmd5 = _get_md5(ctx, st->destpath);
|
||||
|
||||
if( rc > -1 ) {
|
||||
/* set the mtime which is needed in statedb_get_uniqid */
|
||||
if( other ) {
|
||||
other->md5 = tmd5;
|
||||
if (st->type != CSYNC_FTW_TYPE_DIR) {
|
||||
other->md5 = _get_md5(ctx, st->destpath);
|
||||
} else {
|
||||
/* For directories, re-use the old md5 */
|
||||
other->md5 = c_strdup(st->md5);
|
||||
}
|
||||
}
|
||||
/* set instruction for the statedb merger */
|
||||
st->instruction = CSYNC_INSTRUCTION_DELETED;
|
||||
|
|
Loading…
Reference in a new issue