Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Inconsistency between AttributesNode and git check-attr

For a .gitattributes file containing:

images/** filter=lfs

Neither of the following commands will output attributes:

$ git check-attr --all images
$ git check-attr --all images/

Only following command will:

$ git check-attr --all images/a
images/a: filter: lfs

However, AttributesNode rules are matching in all cases:

final AttributesNode attributesNode = new AttributesNode();
attributesNode.parse(new ByteArrayInputStream(new String("images/** filter=lfs").getBytes()));

final AttributesRule rule = attributesNode.getRules().get(0);
System.out.println("OK:    " + rule.isMatch("images/a", false));
System.out.println("WRONG: " + rule.isMatch("images/", false));
System.out.println("WRONG: " + rule.isMatch("images/", true));
System.out.println("WRONG: " + rule.isMatch("images", false));
System.out.println("WRONG: " + rule.isMatch("images", true));

-Marc


Back to the top