]> git.proxmox.com Git - libgit2.git/commit - src/ignore.c
ignore: match git's rule negation rules
authorCarlos Martín Nieto <cmn@dwim.me>
Fri, 5 Dec 2014 17:25:38 +0000 (18:25 +0100)
committerCarlos Martín Nieto <cmn@dwim.me>
Fri, 5 Dec 2014 19:13:24 +0000 (20:13 +0100)
commite05b2ff127e57eaed9900ddd7b9ac199d43268f8
tree0d553f7411300bbe6d9d6636420cba2d39c7b8a0
parente0a97416d417895cb94d519ad0f16942051d302b
ignore: match git's rule negation rules

A rule can only negate something which was explicitly mentioned in the
rules before it. Change our parsing to ignore a negative rule which does
not negate something mentioned in the rules above it.

While here, fix a wrong allocator usage. The memory for the match string
comes from pool allocator. We must not free it with the general
allocator. We can instead simply forget the string and it will be
cleaned up.
src/ignore.c