summaryrefslogtreecommitdiff
path: root/src/pathspec.h
Commit message (Collapse)AuthorAgeFilesLines
* Add git_pathspec_match_diff APIRussell Belfer2013-07-101-2/+10
| | | | | | | | | | | | | | | | | | This adds an additional pathspec API that will match a pathspec against a diff object. This is convenient if you want to handle renames (so you need the whole diff and can't use the pathspec constraint built into the diff API) but still want to tell if the diff had any files that matched the pathspec. When the pathspec is matched against a diff, instead of keeping a list of filenames that matched, instead the API keeps the list of git_diff_deltas that matched and they can be retrieved via a new API git_pathspec_match_list_diff_entry. There are a couple of other minor API extensions here that were mostly for the sake of convenience and to reduce dependencies on knowing the internal data structure between files inside the library.
* Add public API for pathspec matchingRussell Belfer2013-07-101-15/+28
| | | | | | | | | | | | | | | This adds a new public API for compiling pathspecs and matching them against the working directory, the index, or a tree from the repository. This also reworks the pathspec internals to allow the sharing of code between the existing internal usage of pathspec matching and the new external API. While this is working and the new API is ready for discussion, I think there is still an incorrect behavior in which patterns are always matched against the full path of an entry without taking the subdirectories into account (so "s*" will match "subdir/file" even though it wouldn't with core Git). Further enhancements are coming, but this was a good place to take a functional snapshot.
* Add higher level pathspec APIRussell Belfer2013-06-191-0/+14
| | | | | | | | | Right now, setting up a pathspec to be parsed and processed requires several data structures and a couple of API calls. This adds a new high level data structure that contains all the items that you'll need and high-level APIs that do all of the setup and all of the teardown. This will make it easier to use pathspecs in various places with less repeated code.
* Notify '*' pathspec correctly when diffingyorah2013-04-111-1/+1
| | | | I also moved all tests related to notifying in their own file.
* Return the matched pathspec pattern in `git_pathspec_match_path`yorah2013-02-071-2/+10
| | | | | | | Instead of returning directly the pattern as the return value, I used an out parameter, because the function also tests if the passed pathspecs vector is empty. If yes, it considers that the path "matches", but in that case there is no matched pattern per se.
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Move pathspec code in separate filesRussell Belfer2012-11-091-0/+32
Diff uses a `git_strarray` of path specs to represent a subset of all files to be processed. It is useful to be able to reuse this filtering in other places outside diff, so I've moved it into a standalone set of utilities.