mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-25 13:55:47 +03:00
Update the md5 sum of files in merge.
This commit is contained in:
parent
38cf0f2704
commit
972412e436
1 changed files with 14 additions and 6 deletions
|
@ -113,12 +113,12 @@ void csync_memstat_check(void) {
|
|||
|
||||
static int _merge_file_trees_visitor(void *obj, void *data) {
|
||||
csync_file_stat_t *fs = NULL;
|
||||
csync_file_stat_t *tfs = NULL;
|
||||
csync_vio_file_stat_t *vst = NULL;
|
||||
|
||||
CSYNC *ctx = NULL;
|
||||
c_rbtree_t *tree = NULL;
|
||||
c_rbnode_t *node = NULL;
|
||||
char *md5 = NULL;
|
||||
|
||||
char errbuf[256] = {0};
|
||||
char *uri = NULL;
|
||||
|
@ -179,9 +179,7 @@ static int _merge_file_trees_visitor(void *obj, void *data) {
|
|||
goto out;
|
||||
}
|
||||
}
|
||||
md5 = fs->md5;
|
||||
fs = c_rbtree_node_data(node);
|
||||
fs->md5 = md5;
|
||||
|
||||
switch (ctx->current) {
|
||||
case LOCAL_REPLICA:
|
||||
|
@ -221,10 +219,20 @@ static int _merge_file_trees_visitor(void *obj, void *data) {
|
|||
/* update file stat */
|
||||
fs->inode = vst->inode;
|
||||
fs->modtime = vst->mtime;
|
||||
// if( vst->md5 )
|
||||
// fs->md5 = c_strdup(vst->md5);
|
||||
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "file: %s, instruction: UPDATED", uri);
|
||||
/* update with the id from the remote repo */
|
||||
node = c_rbtree_find(ctx->remote.tree, &fs->phash);
|
||||
if (node == NULL) {
|
||||
rc = -1;
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Unable to find node");
|
||||
goto out;
|
||||
}
|
||||
|
||||
tfs = c_rbtree_node_data(node);
|
||||
fs->md5 = c_strdup( tfs->md5 );
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "PRE UPDATED %s: %s <-> %s", uri, fs->md5, tfs->md5);
|
||||
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "file: %s, instruction: UPDATED (%s)", uri, fs->md5);
|
||||
|
||||
fs->instruction = CSYNC_INSTRUCTION_NONE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue