1. 04 Oct, 2017 1 commit
  2. 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
  3. 05 Apr, 2017 1 commit
  4. 28 Feb, 2017 1 commit
    • odb_loose: fsync tests · e6ed0d2f
      Introduce a simple counter that `p_fsync` implements.  This is useful
      for ensuring that `p_fsync` is called when we expect it to be, for
      example when we have enabled an odb backend to perform `fsync`s when
      writing objects.
      Edward Thomson committed
  5. 16 Mar, 2016 1 commit
  6. 01 May, 2015 1 commit
  7. 10 Aug, 2014 1 commit
  8. 05 Aug, 2014 1 commit
  9. 20 May, 2014 1 commit
  10. 16 May, 2014 2 commits
    • indexer: mmap fixes for Windows · 0731a5b4
      Windows has its own ftruncate() called _chsize_s().
      
      p_mkstemp() is changed to use p_open() so we can make sure we open for
      writing; the addition of exclusive create is a good thing to do
      regardless, as we want a temporary path for ourselves.
      
      Lastly, MSVC doesn't quite know how to add two numbers if one of them is a
      void pointer, so let's alias it to unsigned char.C
      Carlos Martín Nieto committed
    • indexer: use mmap for writing · f7310540
      Some OSs cannot keep their ideas about file content straight when mixing
      standard IO with file mapping. As we use mmap for reading from the
      packfile, let's make writing to the pack file use mmap.
      Carlos Martín Nieto committed
  11. 16 Feb, 2014 1 commit
    • Check for EWOULDBLOCK as well as EAGAIN on write. · 0197d410
      On some systems, notably HP PA-RISC systems running Linux or HP-UX,
      EWOULDBLOCK and EAGAIN are not the same value.  POSIX (and these OSes) allow
      EWOULDBLOCK to occur on write(2) (and send(2), etc.), so check explicitly
      for this case as well as EAGAIN by defining and using a macro GIT_ISBLOCKED
      that considers both.
      
      The macro is necessary because MSYS does not provide EWOULDBLOCK and
      compilation fails if an attempt is made to use it unconditionally.  On most
      systems, where the two values are the same, the compiler will simply
      optimize this check out and it will have no effect.
      brian m. carlson committed
  12. 05 Feb, 2014 1 commit
    • Split p_strlen into its own header · 24f3024f
      We need this from util.h and posix.h, but the latter includes common.h
      which includes util.h, which means p_strlen is not defined by the time
      we get to git__strndup().
      
      Split the definition on p_strlen() off into its own header so we can use
      it in util.h.
      Carlos Martín Nieto committed
  13. 03 Jan, 2014 1 commit
  14. 27 Nov, 2013 1 commit
  15. 22 Sep, 2013 1 commit
  16. 19 Aug, 2013 1 commit
  17. 08 Aug, 2013 1 commit
  18. 23 Jun, 2013 1 commit
  19. 09 Mar, 2013 1 commit
    • Make tree iterator handle icase equivalence · e40f1c2d
      There is a serious bug in the previous tree iterator implementation.
      If case insensitivity resulted in member elements being equivalent
      to one another, and those member elements were trees, then the
      children of the colliding elements would be processed in sequence
      instead of in a single flattened list.  This meant that the tree
      iterator was not truly acting like a case-insensitive list.
      
      This completely reworks the tree iterator to manage lists with
      case insensitive equivalence classes and advance through the items
      in a unified manner in a single sorted frame.
      
      It is possible that at a future date we might want to update this
      to separate the case insensitive and case sensitive tree iterators
      so that the case sensitive one could be a minimal amount of code
      and the insensitive one would always know what it needed to do
      without checking flags.
      
      But there would be so much shared code between the two, that I'm
      not sure it that's a win.  For now, this gets what we need.
      
      More tests are needed, though.
      Russell Belfer committed
  20. 08 Jan, 2013 1 commit
  21. 15 Oct, 2012 1 commit
  22. 22 Aug, 2012 1 commit
    • Add template dir and set gid to repo init · ca1b6e54
      This extends git_repository_init_ext further with support for
      initializing the repository from an external template directory
      and with support for the "create shared" type flags that make a
      set GID repository directory.
      
      This also adds tests for much of the new functionality to the
      existing `repo/init.c` test suite.
      
      Also, this adds a bunch of new utility functions including a
      very general purpose `git_futils_mkdir` (with the ability to
      make paths and to chmod the paths post-creation) and a file
      tree copying function `git_futils_cp_r`.  Also, this includes
      some new path functions that were useful to keep the code
      simple.
      Russell Belfer committed
  23. 24 Jun, 2012 1 commit
  24. 22 Jun, 2012 1 commit
  25. 14 Jun, 2012 2 commits
  26. 13 Jun, 2012 1 commit
  27. 11 Jun, 2012 1 commit
  28. 08 Jun, 2012 1 commit
  29. 06 Jun, 2012 1 commit
  30. 07 May, 2012 1 commit
  31. 17 Apr, 2012 1 commit
  32. 02 Mar, 2012 1 commit
    • Update diff to use iterators · 74fa4bfa
      This is a major reorganization of the diff code.  This changes
      the diff functions to use the iterators for traversing the
      content.  This allowed a lot of code to be simplified.  Also,
      this moved the functions relating to outputting a diff into a
      new file (diff_output.c).
      
      This includes a number of other changes - adding utility
      functions, extending iterators, etc. plus more tests for the
      diff code.  This also takes the example diff.c program much
      further in terms of emulating git-diff command line options.
      Russell Belfer committed
  33. 13 Feb, 2012 1 commit
  34. 07 Nov, 2011 1 commit
  35. 14 Oct, 2011 2 commits
    • fileops/repository: create (most) directories with 0777 permissions · ce8cd006
      To further match how Git behaves, this change makes most of the
      directories libgit2 creates in a git repo have a file mode of
      0777. Specifically:
      
      - Intermediate directories created with git_futils_mkpath2file() have
        0777 permissions. This affects odb_loose, reflog, and refs.
      
      - The top level folder for bare repos is created with 0777
        permissions.
      
      - The top level folder for non-bare repos is created with 0755
        permissions.
      
      - /objects/info/, /objects/pack/, /refs/heads/, and /refs/tags/ are
        created with 0777 permissions.
      
      Additionally, the following changes have been made:
      
      - fileops functions that create intermediate directories have grown a
        new dirmode parameter. The only exception to this is filebuf's
        lock_file(), which unconditionally creates intermediate directories
        with 0777 permissions when GIT_FILEBUF_FORCE is set.
      
      - The test runner now sets the umask to 0 before running any
        tests. This ensurses all file mode checks are consistent across
        systems.
      
      - t09-tree.c now does a directory permissions check. I've avoided
        adding this check to other tests that might reuse existing
        directories from the prefabricated test repos. Because they're
        checked into the repo, they have 0755 permissions.
      
      - Other assorted directories created by tests have 0777 permissions.
      Brodie Rao committed
    • fileops/posix: replace usage of "int mode" with "mode_t mode" · 33127043
      Note: Functions exported from fileops take const mode_t, while the
      underlying POSIX wrappers take mode_t.
      Brodie Rao committed
  36. 27 Sep, 2011 1 commit
  37. 22 Sep, 2011 1 commit