Skip to content

Commit 77651c0

Browse files
peffgitster
authored andcommitted
match_pathname(): drop unused "flags" parameter
This field has not been used since the function was introduced in b559263 (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 ed49584 (dir: fix pattern matching on dirs, 2021-09-24) and 5ceb663 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e2841f7 commit 77651c0

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ static int path_matches(const char *pathname, int pathlen,
10231023
}
10241024
return match_pathname(pathname, pathlen - isdir,
10251025
base, baselen,
1026-
pattern, prefix, pat->patternlen, pat->flags);
1026+
pattern, prefix, pat->patternlen);
10271027
}
10281028

10291029
static int macroexpand_one(struct all_attrs_item *all_attrs, int nr, int rem);

dir.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,8 +1244,7 @@ int match_basename(const char *basename, int basenamelen,
12441244

12451245
int match_pathname(const char *pathname, int pathlen,
12461246
const char *base, int baselen,
1247-
const char *pattern, int prefix, int patternlen,
1248-
unsigned flags)
1247+
const char *pattern, int prefix, int patternlen)
12491248
{
12501249
const char *name;
12511250
int namelen;
@@ -1347,8 +1346,7 @@ static struct path_pattern *last_matching_pattern_from_list(const char *pathname
13471346
if (match_pathname(pathname, pathlen,
13481347
pattern->base,
13491348
pattern->baselen ? pattern->baselen - 1 : 0,
1350-
exclude, prefix, pattern->patternlen,
1351-
pattern->flags)) {
1349+
exclude, prefix, pattern->patternlen)) {
13521350
res = pattern;
13531351
break;
13541352
}

dir.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ int match_basename(const char *, int,
414414
const char *, int, int, unsigned);
415415
int match_pathname(const char *, int,
416416
const char *, int,
417-
const char *, int, int, unsigned);
417+
const char *, int, int);
418418

419419
struct path_pattern *last_matching_pattern(struct dir_struct *dir,
420420
struct index_state *istate,

0 commit comments

Comments
 (0)