1. 13 Jun, 2017 2 commits
  2. 06 Jun, 2017 1 commit
    • varint: fix computation for remaining buffer space · 8a5e7aae
      When encoding varints to a buffer, we want to remain sure that the
      required buffer space does not exceed what is actually available. Our
      current check does not do the right thing, though, in that it does not
      honor that our `pos` variable counts the position down instead of up. As
      such, we will require too much memory for small varints and not enough
      memory for big varints.
      
      Fix the issue by correctly calculating the required size as
      `(sizeof(varint) - pos)`. Add a test which failed before.
      Patrick Steinhardt committed
  3. 25 Apr, 2017 1 commit
  4. 22 Mar, 2017 1 commit
  5. 20 Mar, 2017 1 commit
  6. 03 Mar, 2017 1 commit
  7. 25 Feb, 2017 1 commit
  8. 17 Feb, 2017 8 commits
  9. 08 Feb, 2017 2 commits
    • path: ensure dirname on Win32 prefix always has a trailing '/' · 9e8d75c7
      When calling `git_path_dirname_r` on a Win32 prefix, e.g. a drive
      or network share prefix, we always want to return the trailing
      '/'. This does not work currently when passing in a path like
      'C:', where the '/' would not be appended correctly.
      
      Fix this by appending a '/' if we try to normalize a Win32 prefix
      and there is no trailing '/'.
      Patrick Steinhardt committed
    • path: get correct dirname for Windows root · 5d59520c
      Getting the dirname of a filesystem root should return the filesystem
      root itself. E.g. the dirname of "/" is always "/". On Windows, we
      emulate this behavior and as such, we should return e.g. "C:/" if
      calling dirname on "C:/". But we currently fail to do so and instead
      return ".", as we do not check if we actually have a Windows prefix
      before stripping off the last directory component.
      
      Fix this by calling out to `win32_prefix_length` immediately after
      stripping trailing slashes, returning early if we have a prefix.
      Patrick Steinhardt committed
  10. 18 Dec, 2016 1 commit
  11. 18 Nov, 2016 1 commit
    • core::init tests: reverse init/shutdown · 99479062
      We want a predictable number of initializations in our multithreaded
      init test, but we also want to make sure that we have _actually_
      initialized `git_libgit2_init` before calling `git_thread_create` (since
      it now has a sanity check that `git_libgit2_init` has been called).
      
      Since `git_thread_create` is internal-only, keep this sanity check.
      Flip the invocation so that we `git_libgit2_init` before our thread
      tests and `git_libgit2_shutdown` again after.
      Edward Thomson committed
  12. 02 Nov, 2016 1 commit
    • tests: core: test deinitialization and concurrent initialization · 1c33ecc4
      Exercise the logic surrounding deinitialization of the libgit2
      library as well as repeated concurrent de- and reinitialization.
      This tries to catch races and makes sure that it is possible to
      reinitialize libgit2 multiple times.
      
      After deinitializing libgit2, we have to make sure to setup
      options required for testing. Currently, this only includes
      setting up the configuration search path again. Before, this has
      been set up once in `tests/main.c`.
      Patrick Steinhardt committed
  13. 28 Oct, 2016 1 commit
    • pqueue: resolve possible NULL pointer dereference · 95fa3880
      The `git_pqueue` struct allows being fixed in its total number of
      entries. In this case, we simply throw away items that are
      inserted into the priority queue by examining wether the new item
      to be inserted has a higher priority than the previous smallest
      one.
      
      This feature somewhat contradicts our pqueue implementation in
      that it is allowed to not have a comparison function. In fact, we
      also fail to check if the comparison function is actually set in
      the case where we add a new item into a fully filled fixed-size
      pqueue.
      
      As we cannot determine which item is the smallest item in absence
      of a comparison function, we fix the `NULL` pointer dereference
      by simply dropping all new items which are about to be inserted
      into a full fixed-size pqueue.
      Patrick Steinhardt committed
  14. 27 Oct, 2016 1 commit
  15. 07 Oct, 2016 1 commit
  16. 06 Oct, 2016 2 commits
  17. 10 Aug, 2016 1 commit
  18. 06 Jul, 2016 1 commit
  19. 05 Jul, 2016 1 commit
  20. 29 Jun, 2016 1 commit
  21. 26 May, 2016 6 commits
  22. 06 Apr, 2016 1 commit
    • tests: fix core/stream test when built with openssl off · 04f47a43
      When passing -DUSE_OPENSSL:BOOL=OFF to cmake the testsuite will
      fail with the following error:
      
      core::stream::register_tls [/tmp/libgit2/tests/core/stream.c:40]
        Function call failed: (error)
        error -1 - <no message>
      
      Fix test to assume failure for tls when built without openssl.
      While at it also fix GIT_WIN32 cpp to check if it's defined
      or not.
      Andreas Henriksson committed
  23. 31 Mar, 2016 1 commit
  24. 24 Mar, 2016 1 commit
  25. 22 Mar, 2016 1 commit