]> git.proxmox.com Git - libgit2.git/commit
Add public API for pathspec matching
authorRussell Belfer <rb@github.com>
Tue, 25 Jun 2013 06:16:06 +0000 (23:16 -0700)
committerVicent Marti <tanoku@gmail.com>
Wed, 10 Jul 2013 18:50:31 +0000 (20:50 +0200)
commitd2ce27dd494b65f54b2d110b4defd69aea976115
tree5e81ac8f401fd5a15f73409a6c74142a0ee5e4ca
parentd39fff36484e908438beb17ee043689962182460
Add public API for pathspec matching

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.
include/git2/index.h
include/git2/pathspec.h [new file with mode: 0644]
src/checkout.c
src/diff.c
src/index.c
src/index.h
src/pathspec.c
src/pathspec.h
tests-clar/repo/pathspec.c [new file with mode: 0644]