1. 09 May, 2018 6 commits
  2. 07 May, 2018 5 commits
  3. 05 May, 2018 1 commit
  4. 04 May, 2018 5 commits
    • Merge pull request #4380 from cjhoward92/examples/ls-files · 0c6f631c
      examples: ls-files: add ls-files to list paths in the index
      Patrick Steinhardt committed
    • tests: iterator::workdir: fix GCC warning · 1bf57b5a
      Since GCC 8.1, the compiler performs some bounds checking when
      copying static data into arrays with a known size. In one test,
      we print a format string of "%s/sub%02d" into a buffer of 64
      bytes. The input buffer for the first "%s" is bounded to at most
      63 characters, plus four bytes for the static string "/sub" plus
      two more bytes for "%02d". Thus, our target buffer needs to be at
      least 70 bytes in size, including the NUL byte. There seems to be
      a bug in the analysis, though, because GCC will not account for
      the limiting "%02" prefix, treating it as requiring the same
      count of bytes as a "%d".
      
      Thus, we end up at 79 bytes that are required to fix the
      warning. To make it look nicer and less special, we just round
      the buffer size up to 80 bytes.
      Patrick Steinhardt committed
    • tests: refs::normalize: simplify code to avoid GCC warning · 0750d0cc
      Since version 8.1, GCC will do some automatic bounds checking
      when printing static content into a buffer with known size. The
      bounds checking doesn't yet work quite right in all scenarios and
      may thus lead to false positives. Fix one of these false
      positives in refs::normalize by simplifying the code.
      Patrick Steinhardt committed
    • streams: openssl: fix bogus warning on unused parameter · ba5e39ac
      Our provided callback function `threadid_cb(CRYPTO_THREADID
      *threadid)` sets up a unique thread ID by asking pthread for the
      current thread ID.  Since openssl version 1.1,
      `CRYPTO_THREADID_set_numeric` is simply a no-op macro, leaving
      the `threadid` argument unused after the preprocessor has
      processed the macro. GCC does not account for that situation and
      will thus complain about `threadid` being unused.
      
      Silence this warning by using `GIT_UNUSED(threadid)`.
      Patrick Steinhardt committed
    • global: adjust init count under lock · 0933fdc5
      Our global initialization functions `git_libgit2_init()` and
      `git_libgit2_shutdown()` both adjust a global init counter to determine
      whether we are the first respectively last user of libgit2. On
      Unix-systems do not do so under lock, though, which opens the
      possibility of a race between these two functions:
      
          Thread 1                            Thread 2
                                  git__n_inits = 0;
          git_libgit2_init();
          git_atomic_inc(&git__n_inits);
          /* git__n_inits == 1 */
                                              git_libgit2_shutdown();
                                              if (git_atomic_dec(&git__n_inits) != 0)
                                                  /* git__n_inits == 0, no early exit here */
                                              pthread_mutex_lock(&_init_mutex);
                                              shutdown_common();
                                              pthread_mutex_unlock(&_init_mutex);
          pthread_mutex_lock(&_init_mutex);
          init_once();
          pthread_mutex_unlock(&_init_mutex);
      
      So we can end up in a situation where we try to shutdown shared data
      structures before they have been initialized.
      
      Fix the race by always locking `_init_mutex` before incrementing or
      decrementing `git__n_inits`.
      Patrick Steinhardt committed
  5. 02 May, 2018 2 commits
  6. 30 Apr, 2018 3 commits
  7. 27 Apr, 2018 2 commits
  8. 26 Apr, 2018 1 commit
  9. 25 Apr, 2018 2 commits
  10. 22 Apr, 2018 3 commits
  11. 20 Apr, 2018 10 commits