libgit2/tests-clar
Russell Belfer bd4ca902b5 Fix status for files under ignored dirs
There was a bug where tracked files inside directories that were
inside ignored directories where not being found by status.  To
make that a little clearer, if you have a .gitignore with:

    ignore/

And then have the following files:

    ignore/dir/tracked     <-- actually a tracked file
    ignore/dir/untracked   <-- should be ignored

Then we would show the tracked file as being removed (because
when we got the to contained item "dir/" inside the ignored
directory, we decided it was safe to skip -- bzzt, wrong!).

This update is much more careful about checking that we are
not skipping over any prefix of a tracked item, regardless of
whether it is ignored or not.

As documented in diff.c, this commit does create behavior that
still differs from core git with regards to the handling of
untracked files contained inside ignored directories.  With
libgit2, those files will just not show up in status or diff.
With core git, those files don't show up in status or diff
either *unless* they are explicitly ignored by a .gitignore
pattern in which case they show up as ignored files.

Needless to say, this is a local behavior difference only, so
it should not be important and (to me) the libgit2 behavior
seems more consistent.
2012-05-16 17:08:59 -07:00
..
attr Support reading attributes from index 2012-05-03 16:37:25 -07:00
buf Update test suite 2012-05-02 16:14:30 -07:00
commit tests-clar/commit: fix memory leaks 2012-04-03 11:07:04 +02:00
config Update test suite 2012-05-02 16:14:30 -07:00
core Ranged iterators and rewritten git_status_file 2012-05-15 14:34:15 -07:00
diff Ranged iterators and rewritten git_status_file 2012-05-15 14:34:15 -07:00
index Update test suite 2012-05-02 16:14:30 -07:00
network remotes: change git_remote_new's signature 2012-05-08 21:36:40 +02:00
notes notes: make git_note_foreach() callback signature easier to cope with from a binding perspective 2012-05-16 21:51:45 +02:00
object tree: Naming conventions 2012-05-16 19:24:35 +02:00
odb clar: Fix warning 2012-05-16 19:24:35 +02:00
refs Merge pull request #693 from nulltoken/topic/enhance_branch_move_test_coverage 2012-05-14 11:25:55 -07:00
repo Fixed leaks and added tests 2012-05-11 12:16:19 -07:00
resources Fix status for files under ignored dirs 2012-05-16 17:08:59 -07:00
revwalk mergebase: enhance test code coverage 2012-05-13 14:14:08 +02:00
status Fix status for files under ignored dirs 2012-05-16 17:08:59 -07:00
threads t13-threads.c ported. 2012-03-30 13:05:54 -07:00
clar Fixed mode on clar 2012-05-10 11:15:37 -07:00
clar_helpers.c compat: make p_open able to accept optional mode when passing the O_CREAT flag 2012-05-07 12:18:54 +02:00
clar_libgit2.h clar helper: don't dereference giterr_last() if it's NULL 2012-05-07 11:29:10 +02:00
README.md Rename the Clay test suite to Clar 2012-01-24 20:35:15 -08:00

Writing Clar tests for libgit2

For information on the Clar testing framework and a detailed introduction please visit:

https://github.com/tanoku/clar

  • Write your modules and tests. Use good, meaningful names.

  • Make sure you actually build the tests by setting:

      cmake -DBUILD_CLAR=ON build/
    
  • Test:

      ./build/libgit2_clar
    
  • Make sure everything is fine.

  • Send your pull request. That's it.