summaryrefslogtreecommitdiff
path: root/tests-clar/attr/repo.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename tests-clar to testsBen Straub2013-11-141-310/+0
|
* Add attributes to filters and fix registryRussell Belfer2013-09-171-0/+16
| | | | | | | | | | | | | | | | | | The filter registry as implemented was too primitive to actually work once multiple filters were coming into play. This expands the implementation of the registry to handle multiple prioritized filters correctly. Additionally, this adds an "attributes" field to a filter that makes it really really easy to implement filters that are based on one or more attribute values. The lookup and even simple value checking can all happen automatically without custom filter code. Lastly, with the registry improvements, this fills out the filter lifecycle callbacks, with initialize and shutdown callbacks that will be called before the filter is first used and after it is last invoked. This allows for system-wide initialization and cleanup by the filter.
* Vector improvements and their falloutPhilip Kelley2013-01-271-3/+2
|
* add an index_remove_bypath that removes conflicts, renamed add_from_workdir ↵Edward Thomson2013-01-121-1/+1
| | | | to match
* API updates for index.hBen Straub2012-11-271-1/+1
|
* index refactoringEdward Thomson2012-10-291-2/+2
|
* Update iterators for consistency across libraryRussell Belfer2012-08-031-0/+22
| | | | | | | | | | | | | | | | | This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules.
* Fix bugs for status with spaces and reloaded attrsRussell Belfer2012-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | This fixes two bugs: * Issue #728 where git_status_file was not working for files that contain spaces. This was caused by reusing the "fnmatch" parsing code from ignore and attribute files to interpret the "pathspec" that constrained the files to apply the status to. In that code, unescaped whitespace was considered terminal to the pattern, so a file with internal whitespace was excluded from the matched files. The fix was to add a mode to that code that allows spaces and tabs inside patterns. This mode only comes into play when parsing in-memory strings. * The other issue was undetected, but it was in the recently added code to reload gitattributes / gitignores when they were changed on disk. That code was not clearing out the old values from the cached file content before reparsing which meant that newly added patterns would be read in, but deleted patterns would not be removed. The fix was to clear the vector of patterns in a cached file before reparsing the file.
* global: Fix unit tests after reorderingVicent Martí2012-05-181-13/+13
|
* Support reading attributes from indexRussell Belfer2012-05-031-19/+20
| | | | | | | | | | | | | | 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: add test coverage related to crlf normalization while stagingnulltoken2012-05-011-6/+50
|
* Update clar and remove old helpersRussell Belfer2012-04-171-5/+5
| | | | | | This updates to the latest clar which includes the helpers `cl_assert_equal_s` and `cl_assert_equal_i`. Convert the code over to use those and remove the old libgit2-only helpers.
* Convert attr, ignore, mwindow, status to new errorsRussell Belfer2012-03-161-4/+4
| | | | | Also cleaned up some previously converted code that still had little things to polish.
* Fixes for merge of filters branchRussell Belfer2012-03-021-0/+1
|
* Clean up GIT_UNUSED macros on all platformsRussell Belfer2012-03-021-4/+4
| | | | | | | | | | | | | | | | | | | It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
* Add test for possible attr bugRussell Belfer2012-03-021-2/+3
| | | | | This is a test that should replicate an issue that Peff is setting with git attributes. But the test doesn't fail.
* attr: Change the attribute check macrosVicent Martí2012-03-021-91/+70
| | | | | | | | | | | | | | | | | | | | | 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.
* Add unit tests for recent bug fixesRussell Belfer2012-02-011-0/+5
| | | | | | Add unit tests to confirm ignore directory pattern matches and to confirm that ignore and attribute files are loaded properly into the attribute file cache.
* Rename the Clay test suite to ClarVicent Martí2012-01-241-0/+242
Clay is the name of a programming language on the makings, and we want to avoid confusions. Sorry for the huge diff!