From f167879035940c9bc30b687699fdd309e549b5f5 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 1 Sep 2006 00:42:39 +0000 Subject: [PATCH] Matt pointed out that the code was not properly dropping excludes that were read from a per-dir merge file when --delete-excluded is enabled. This additional code fixes that. --- exclude.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/exclude.c b/exclude.c index dc1a4754..71bc3bda 100644 --- a/exclude.c +++ b/exclude.c @@ -847,6 +847,14 @@ static const char *parse_rule_tok(const char *p, uint32 mflags, int xflags, exit_cleanup(RERR_SYNTAX); } + /* --delete-excluded turns an un-modified include/exclude into a + * sender-side rule. We also affect a per-dir .cvsignore file so + * that we are compatible with older protocol versions. */ + if (delete_excluded + && !(new_mflags & (MATCHFLG_RECEIVER_SIDE|MATCHFLG_SENDER_SIDE)) + && (!(new_mflags & MATCHFLG_PERDIR_MERGE) || new_mflags & MATCHFLG_CVS_IGNORE)) + new_mflags |= MATCHFLG_SENDER_SIDE; + *len_ptr = len; *mflags_ptr = new_mflags; return (const char *)s; @@ -1098,6 +1106,9 @@ static void send_rules(int f_out, struct filter_list_struct *flp) int elide = 0; char *p; + /* Note we need to check delete_excluded here in addition to + * the code in parse_rule_tok() because some rules may have + * been added before we found the --delete-excluded option. */ if (ent->match_flags & MATCHFLG_SENDER_SIDE) elide = am_sender ? 1 : -1; if (ent->match_flags & MATCHFLG_RECEIVER_SIDE) -- 2.34.1