summaryrefslogtreecommitdiff
path: root/include/git2/attr.h
Commit message (Collapse)AuthorAgeFilesLines
* attr: Do not export variables externallyattr-exportVicent Marti2012-08-021-9/+25
| | | | | | | | | | Fixes #824 Exporting variables in a dynamic library is a PITA. Let's keep these values internally and wrap them through a helper method. This doesn't break the external API. @arrbee, aren't you glad I turned the `GIT_ATTR_` macros into function macros? :sparkles:
* attr: Rename the `git_attr__` exportsVicent Marti2012-07-151-8/+8
| | | | | | | Pevents collisions with the original libgit, which also exports those exact symbols. Fixes #822
* Fix spelling errors.Bruce Mitchener2012-05-191-1/+1
|
* global: Change parameter ordering in APIVicent Martí2012-05-181-16/+16
| | | | Consistency is good.
* Fix memory leaks and use after freeRussell Belfer2012-05-041-3/+3
|
* Support reading attributes from indexRussell Belfer2012-05-031-11/+155
| | | | | | | | | | | | | | Depending on the operation, we need to consider gitattributes in both the work dir and the index. This adds a parameter to all of the gitattributes related functions that allows user control of attribute reading behavior (i.e. prefer workdir, prefer index, only use index). This fix also covers allowing us to check attributes (and hence do diff and status) on bare repositories. This was a somewhat larger change that I hoped because it had to change the cache key used for gitattributes files.
* attr: Change the attribute check macrosVicent Martí2012-03-021-5/+5
| | | | | | | | | | | | | | | | | | | | | The point of having `GIT_ATTR_TRUE` and `GIT_ATTR_FALSE` macros is to be able to change the way that true and false values are stored inside of the returned gitattributes value pointer. However, if these macros are implemented as a simple rename for the `git_attr__true` pointer, they will always be used with the `==` operator, and hence we cannot really change the implementation to any other way that doesn't imply using special pointer values and comparing them! We need to do the same thing that core Git does, which is using a function macro. With `GIT_ATTR_TRUE(attr)`, we can change internally the way that these values are stored to anything we want. This commit does that, and rewrites a large chunk of the attributes test suite to remove duplicated code for expected attributes, and to properly test the function macro behavior instead of comparing pointers.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Add support for macros and cache flush API.Russell Belfer2011-12-291-0/+24
| | | | | | | | | | | | | | Add support for git attribute macro definitions. Also, add support for cache flush API to clear the attribute file content cache when needed. Additionally, improved the handling of global and system files, making common utility functions in fileops and converting config and attr to both use the common functions. Adds a bunch more tests and fixed some memory leaks. Note that adding macros required me to use refcounted attribute assignment definitions, which complicated, but probably improved memory usage.
* Add APIs for git attributesRussell Belfer2011-12-201-0/+56
This adds APIs for querying git attributes. In addition to the new API in include/git2/attr.h, most of the action is in src/attr_file.[hc] which contains utilities for dealing with a single attributes file, and src/attr.[hc] which contains the implementation of the APIs that merge all applicable attributes files.