1 auto repo = initRepo(_userRepo, OpenBare.no); 2 assert(!repo.isPathIgnored("/foo")); 3 4 repo.addIgnoreRules("/foo"); 5 assert(repo.isPathIgnored("/foo")); 6 7 repo.addIgnoreRules(["/foo", "/bar"]); 8 assert(repo.isPathIgnored("/bar")); 9 10 repo.clearIgnoreRules(); 11 assert(!repo.isPathIgnored("/foo")); 12 assert(!repo.isPathIgnored("/bar"));
Test if the ignore rules apply to a given path.
This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.
One way to think of this is if you were to do "git add ." on the directory containing the file, would it be added or not?