• Show log

    Commit

  • Hash : 7d55bee6
    Author : Patrick Steinhardt
    Date : 2020-01-10T12:44:51

    win32: fix relative symlinks pointing into dirs
    
    On Windows platforms, we need some logic to emulate symlink(3P) defined
    by POSIX. As unprivileged symlinks on Windows are a rather new feature,
    our current implementation is comparatively new and still has some
    rough edges in special cases.
    
    One such case is relative symlinks. While relative symlinks to files in
    the same directory work as expected, libgit2 currently fails to create
    reltaive symlinks pointing into other directories. This is due to the
    fact that we forgot to translate the Unix-style target path to
    Windows-style. Most importantly, we are currently not converting
    directory separators from "/" to "\".
    
    Fix the issue by calling `git_win32_path_canonicalize` on the target.
    Add a test that verifies our ability to create such relative links
    across directories.
    

  • 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