Merge branch 'jc/pathspec-match-with-common-prefix'

"git ls-files '(attr:X)D/'" that triggers the common prefix
optimization codepath failed to read from "D/.gitattributes",
which has been corrected.

* jc/pathspec-match-with-common-prefix:
  dir: match "attr" pathspec magic with correct paths
  t6135: attr magic with path pattern
This commit is contained in:
Junio C Hamano
2023-07-17 11:30:42 -07:00
2 changed files with 45 additions and 3 deletions

2
dir.c
View File

@ -376,7 +376,7 @@ static int match_pathspec_item(struct index_state *istate,
return 0;
if (item->attr_match_nr &&
!match_pathspec_attrs(istate, name, namelen, item))
!match_pathspec_attrs(istate, name - prefix, namelen + prefix, item))
return 0;
/* If the match was just the prefix, we matched */