summaryrefslogtreecommitdiff
path: root/tests-clar/diff/workdir.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix git_status_file for files that start with a character > 0x7f8bit-filename-statusAdam Roben2012-06-071-10/+10
| | | | | | | | | | | | | | | | git_status_file would always return GIT_ENOTFOUND for these files. The underlying bug was that git__strcmp_cb, which is used by git_path_with_stat_cmp to sort entries in the working directory, compares strings based on unsigned chars (this is confirmed by the strcmp(3) manpage), while git__prefixcmp, which is used by workdir_iterator__entry_cmp to search for a path in the working directory, compares strings based on char. So the sort puts this path at the end of the list, while the search expects it to be at the beginning. The fix was simply to make git__prefixcmp compare using unsigned chars, just like strcmp(3). The rest of the change is just adding/updating tests.
* Update clar and remove old helpersRussell Belfer2012-04-171-13/+13
| | | | | | 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.
* Add support for pathspec to diff and statusRussell Belfer2012-04-131-0/+73
| | | | | | | This adds preliminary support for pathspecs to diff and status. The implementation is not very optimized (it still looks at every single file and evaluated the the pathspec match against them), but it works.
* Fixing memory leaks indicated by valgrindRussell Belfer2012-03-021-0/+2
| | | | | This clears up the memory leaks that valgrind seems to find on my machine.
* Clean up GIT_UNUSED macros on all platformsRussell Belfer2012-03-021-6/+2
| | | | | | | | | | | | | | | | | | | 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.
* Update diff to use iteratorsRussell Belfer2012-03-021-0/+230
This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.