]> git.ipfire.org Git - thirdparty/git.git/commitdiff
match_pathname(): drop unused "flags" parameter
authorJeff King <peff@peff.net>
Fri, 19 Aug 2022 08:50:54 +0000 (04:50 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Aug 2022 19:20:56 +0000 (12:20 -0700)
This field has not been used since the function was introduced in
b559263216 (exclude: split pathname matching code into a separate
function, 2012-10-15), though there was a brief period where it was
erroneously used and then reverted in ed4958477b (dir: fix pattern
matching on dirs, 2021-09-24) and 5ceb663e92 (dir: fix
directory-matching bug, 2021-11-02).

It's possible we'd eventually add a flag that makes it useful here, but
there are only a handful of callers. It would be easy to add back if
necessary, and in the meantime this makes the function interface less
misleading.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr.c
dir.c
dir.h

diff --git a/attr.c b/attr.c
index 21e4ad25ada625885ebcc524facf6a9ce816d39e..8a78dde69efd5822ee078ba79e5e0a47e5a2364b 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -1023,7 +1023,7 @@ static int path_matches(const char *pathname, int pathlen,
        }
        return match_pathname(pathname, pathlen - isdir,
                              base, baselen,
-                             pattern, prefix, pat->patternlen, pat->flags);
+                             pattern, prefix, pat->patternlen);
 }
 
 static int macroexpand_one(struct all_attrs_item *all_attrs, int nr, int rem);
diff --git a/dir.c b/dir.c
index d7cfb08e441825f421f91a982063e00be4168c71..50eeb8b11eb1ffd3069096fc5d81e9defad69648 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1244,8 +1244,7 @@ int match_basename(const char *basename, int basenamelen,
 
 int match_pathname(const char *pathname, int pathlen,
                   const char *base, int baselen,
-                  const char *pattern, int prefix, int patternlen,
-                  unsigned flags)
+                  const char *pattern, int prefix, int patternlen)
 {
        const char *name;
        int namelen;
@@ -1347,8 +1346,7 @@ static struct path_pattern *last_matching_pattern_from_list(const char *pathname
                if (match_pathname(pathname, pathlen,
                                   pattern->base,
                                   pattern->baselen ? pattern->baselen - 1 : 0,
-                                  exclude, prefix, pattern->patternlen,
-                                  pattern->flags)) {
+                                  exclude, prefix, pattern->patternlen)) {
                        res = pattern;
                        break;
                }
diff --git a/dir.h b/dir.h
index 7bc862030cfb3bbc97cd3b9f6523696662e12633..674747d93af7ad903b1e78a1418ff07c914a69ec 100644 (file)
--- a/dir.h
+++ b/dir.h
@@ -414,7 +414,7 @@ int match_basename(const char *, int,
                   const char *, int, int, unsigned);
 int match_pathname(const char *, int,
                   const char *, int,
-                  const char *, int, int, unsigned);
+                  const char *, int, int);
 
 struct path_pattern *last_matching_pattern(struct dir_struct *dir,
                                           struct index_state *istate,