• Show log

    Commit

  • Hash : d04c1aa0
    Author : Patrick Steinhardt
    Date : 2018-11-28T13:36:47

    config: fix adding files if their parent directory is a file
    
    When we try to add a configuration file with `git_config_add_file_ondisk`, we
    treat nonexisting files as empty. We do this by performing a stat call, ignoring
    ENOENT errors. This works just fine in case the file or any of its parents
    simply does not exist, but there is also the case where any of the parent
    directories is not a directory, but a file. So e.g. trying to add a
    configuration file "/dev/null/.gitconfig" will fail, as `errno` will be ENOTDIR
    instead of ENOENT.
    
    Catch ENOTDIR in addition to ENOENT to fix the issue. Add a test that verifies
    we are able to add configuration files with such an invalid path file just fine.
    

  • 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.