• Show log

    Commit

  • Hash : 50194dcd
    Author : Patrick Steinhardt
    Date : 2019-07-11T15:14:42

    win32: fix symlinks to relative file targets
    
    When creating a symlink in Windows, one needs to tell Windows whether
    the symlink should be a file or directory symlink. To determine which
    flag to pass, we call `GetFileAttributesW` on the target file to see
    whether it is a directory and then pass the flag accordingly. The
    problem though is if create a symlink with a relative target path, then
    we will check that relative path while not necessarily being inside of
    the working directory where the symlink is to be created. Thus, getting
    its attributes will either fail or return attributes of the wrong
    target.
    
    Fix this by resolving the target path relative to the directory in which
    the symlink is to be created.
    

  • 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