• Show log

    Commit

  • Hash : d29d4de2
    Author : Johannes Schindelin
    Date : 2019-09-18T15:08:56

    cl_git_fail: do not report bogus error message
    
    When we expect a checkout operation to fail, but it succeeds, we
    actually do not want to see the error messages that were generated in
    the meantime for errors that were handled gracefully by the code (e.g.
    when an object could not be found in a pack: in this case, the next
    backend would have been given a chance to look up the object, and
    probably would have found it because the checkout succeeded, after all).
    
    Which means that in the specific case of `cl_git_fail()`, we actually
    want to clear the global error state _after_ evaluating the command: we
    know that any still-available error would be bogus, seeing as the
    command succeeded (unexpectedly).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    

  • README.md

  • Writing Clar tests for libgit2

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

    https://github.com/vmg/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.

    Memory leak checks

    These are automatically run as part of CI, but if you want to check locally:

    Linux

    Uses valgrind:

    $ cmake -DBUILD_CLAR=ON -DVALGRIND=ON ..
    $ cmake --build .
    $ valgrind --leak-check=full --show-reachable=yes --num-callers=50 --suppressions=../libgit2_clar.supp \
      ./libgit2_clar

    macOS

    Uses leaks, which requires XCode installed:

    $ MallocStackLogging=1 MallocScribble=1 MallocLogFile=/dev/null CLAR_AT_EXIT="leaks -quiet \$PPID" \
      ./libgit2_clar