[Pkg-owncloud-commits] [owncloud-client] 332/498: csync_update: Reorg the code a bit to make it easier to read and understand

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:03 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit c72b6fb8e6c73d90f4be0bd53089e42db562044d
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Jul 15 15:01:27 2015 +0200

    csync_update: Reorg the code a bit to make it easier to read and understand
---
 csync/src/csync_update.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/csync/src/csync_update.c b/csync/src/csync_update.c
index 3fd98eb..cf73f31 100644
--- a/csync/src/csync_update.c
+++ b/csync/src/csync_update.c
@@ -166,7 +166,17 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
   /* Check if file is excluded */
   excluded = csync_excluded(ctx, path,type);
 
-  if (excluded != CSYNC_NOT_EXCLUDED) {
+  if( excluded == CSYNC_NOT_EXCLUDED ) {
+      /* Even if it is not excluded by a pattern, maybe it is to be ignored
+       * because it's a hidden file that should not be synced.
+       * This code should probably be in csync_exclude, but it does not have the fs parameter.
+       * Keep it here for now */
+      if (ctx->ignore_hidden_files && (fs->flags & CSYNC_VIO_FILE_FLAGS_HIDDEN)) {
+          CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file excluded because it is a hidden file: %s", path);
+          excluded = CSYNC_FILE_EXCLUDE_HIDDEN;
+      }
+  } else {
+      /* File is ignored because it's matched by a user- or system exclude pattern. */
       CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "%s excluded  (%d)", path, excluded);
       if (excluded == CSYNC_FILE_EXCLUDE_AND_REMOVE) {
           return 1;
@@ -174,13 +184,6 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
       if (excluded == CSYNC_FILE_SILENTLY_EXCLUDED) {
           return 1;
       }
-  } else {
-      /* This code should probably be in csync_exclude, but it does not have the fs parameter.
-         Keep it here for now */
-      if (ctx->ignore_hidden_files && (fs->flags & CSYNC_VIO_FILE_FLAGS_HIDDEN)) {
-          CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file excluded because it is a hidden file: %s", path);
-          excluded = CSYNC_FILE_EXCLUDE_HIDDEN;
-      }
   }
 
   if (ctx->current == REMOTE_REPLICA && ctx->callbacks.checkSelectiveSyncBlackListHook) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list