1. 15 Feb, 2019 1 commit
    • strmap: introduce high-level setter for key/value pairs · 03555830
      Currently, one would use the function `git_strmap_insert` to insert key/value
      pairs into a map. This function has historically been a macro, which is why its
      syntax is kind of weird: instead of returning an error code directly, it instead
      has to be passed a pointer to where the return value shall be stored. This does
      not match libgit2's common idiom of directly returning error codes.
      
      Introduce a new function `git_strmap_set`, which takes as parameters the map,
      key and value and directly returns an error code. Convert all callers of
      `git_strmap_insert` to make use of it.
      Patrick Steinhardt committed
  2. 22 Jan, 2019 1 commit
  3. 10 Jun, 2018 1 commit
  4. 26 Dec, 2017 1 commit
  5. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  6. 10 Jun, 2017 1 commit
  7. 08 Jun, 2017 1 commit
  8. 12 Apr, 2017 1 commit
  9. 04 Apr, 2017 1 commit
    • fileops: do not overwrite correct error message on mmap · 9daba9f4
      When executing `git_futils_mmap_ro_file`, we first try to guess whether
      the file is mmapable at all. Part of this check is whether the file is
      too large to be mmaped, which can be true on systems with 32 bit
      `size_t` types.
      
      The check is performed by first getting the file size wtih
      `git_futils_filesize` and then checking whether the returned size can be
      represented as `size_t`, returning an error if so. While this test also
      catches the case where the function returned an error (as `-1` is not
      representable by `size_t`), we will set the misleading error message
      "file too large to mmap". But in fact, a negative return value from
      `git_futils_filesize` will be caused by the inability to fstat the file.
      
      Fix the error message by handling negative return values separately and
      not overwriting the error message in that case.
      Patrick Steinhardt committed
  10. 22 Mar, 2017 1 commit
  11. 09 Mar, 2017 1 commit
  12. 28 Feb, 2017 4 commits
  13. 17 Feb, 2017 2 commits
  14. 29 Dec, 2016 1 commit
  15. 14 Nov, 2016 1 commit
  16. 04 Aug, 2016 2 commits
  17. 25 Feb, 2016 1 commit
    • nsec: support NDK's crazy nanoseconds · 3d6a42d1
      Android NDK does not have a `struct timespec` in its `struct stat`
      for nanosecond support, instead it has a single nanosecond member inside
      the struct stat itself.  We will use that and use a macro to expand to
      the `st_mtim` / `st_mtimespec` definition on other systems (much like
      the existing `st_mtime` backcompat definition).
      Edward Thomson committed
  18. 09 Feb, 2016 1 commit
  19. 20 Nov, 2015 1 commit
  20. 30 Oct, 2015 2 commits
  21. 02 Oct, 2015 1 commit
  22. 19 Sep, 2015 2 commits
  23. 17 Sep, 2015 4 commits
  24. 17 May, 2015 1 commit
  25. 15 May, 2015 1 commit
  26. 11 May, 2015 1 commit
  27. 19 Mar, 2015 1 commit
  28. 15 Feb, 2015 1 commit
  29. 13 Feb, 2015 2 commits