1. 01 Jun, 2020 6 commits
  2. 26 May, 2020 1 commit
  3. 25 May, 2020 1 commit
  4. 23 May, 2020 5 commits
  5. 16 May, 2020 2 commits
    • checkout: fix file being treated as unmodified due to racy index · 3f201f75
      When trying to determine whether a file changed, we try to avoid heavy
      operations by fist taking a look at the index, seeing whether the index
      entry is modified already. This doesn't seem to cut it, though, as we
      currently have the racy checkout::index::can_disable_pathspec_match test
      case: sometimes the files get restored to their original contents,
      sometimes they aren't.
      
      The issue is caused by a racy index [1]: in case we modify a file, add
      it to the index and then modify it again in-place without changing its
      file, then we may end up with a modified file that has the same stat(3P)
      info as we've currently got it in its corresponding index entry. The
      mitigation for this is to treat files with the same mtime as the index
      are treated as racily modified. We already have this logic in place for
      the index, but not when doing a checkout.
      
      Fix the issue by only consulting the index entry in case it has an older
      mtime as the index. Previously, the following script reliably had at
      least 20 failures, while now there is no failure to be observed anymore:
      
      ```bash
      j=0
      for i in $(seq 100)
      do
      	if ! ./libgit2_clar -scheckout::index::can_disable_pathspec_match >/dev/null
      	then
      		j=$(($j + 1))
      	fi
      done
      echo "Failures: $j"
      ```
      
      [1]: https://git-scm.com/docs/racy-git
      Patrick Steinhardt committed
    • tests: checkout: fix stylistic issues and static variable · 915f8860
      The test case checkout::index::can_disable_pathspec_match has some
      shortcomings when it comes to coding style, which didn't fit our own
      coding style. Furthermore, it had an unnecessary static local variable.
      
      The test has been refactored to address these issues.
      Patrick Steinhardt committed
  6. 15 May, 2020 2 commits
    • cmake: Sort source files for reproducible builds · b85eefb4
      We currently use `FILE(GLOB ...)` in most places to find source and
      header files. This is problematic in that the order of files returned
      depends on the operating system's directory iteration order and may thus
      not be deterministic. As a result, we link object files in unspecified
      order, which may cause the linker to emit different code across runs.
      
      Fix this issue by sorting all code used as input to the libgit2 library
      to improve the reliability of reproducible builds.
      Patrick Steinhardt committed
    • streams: openssl: fix memleak due to us not free'ing certs · b43a9e66
      When creating a `git_cert` from the OpenSSL X509 certificate of a given
      stream, we do not call `X509_free()` on the certificate, leading to a
      memory leak as soon as the certificate is requested e.g. by the
      certificate check callback.
      
      Fix the issue by properly calling `X509_free()`.
      Patrick Steinhardt committed
  7. 12 May, 2020 7 commits
  8. 11 May, 2020 9 commits
  9. 10 May, 2020 7 commits