1. 31 Jan, 2022 1 commit
  2. 05 Jan, 2022 1 commit
  3. 15 Nov, 2021 1 commit
  4. 09 Nov, 2021 1 commit
  5. 17 Oct, 2021 1 commit
    • str: introduce `git_str` for internal, `git_buf` is external · f0e693b1
      libgit2 has two distinct requirements that were previously solved by
      `git_buf`.  We require:
      
      1. A general purpose string class that provides a number of utility APIs
         for manipulating data (eg, concatenating, truncating, etc).
      2. A structure that we can use to return strings to callers that they
         can take ownership of.
      
      By using a single class (`git_buf`) for both of these purposes, we have
      confused the API to the point that refactorings are difficult and
      reasoning about correctness is also difficult.
      
      Move the utility class `git_buf` to be called `git_str`: this represents
      its general purpose, as an internal string buffer class.  The name also
      is an homage to Junio Hamano ("gitstr").
      
      The public API remains `git_buf`, and has a much smaller footprint.  It
      is generally only used as an "out" param with strict requirements that
      follow the documentation.  (Exceptions exist for some legacy APIs to
      avoid breaking callers unnecessarily.)
      
      Utility functions exist to convert a user-specified `git_buf` to a
      `git_str` so that we can call internal functions, then converting it
      back again.
      Edward Thomson committed
  6. 02 Oct, 2021 1 commit
  7. 16 Jun, 2021 1 commit
  8. 12 May, 2020 1 commit
    • futils: fix order of declared parameters for `git_futils_fake_symlink` · a2eca682
      While the function `git_futils_fake_symlink` is declared with arguments
      `new, old`, the implementation uses the reverse order `old, new`. Let's
      fix the ordering issues to be `new, old` for both, which matches what
      symlink(3P) has. While at it, we also rename these parameters: `old` and
      `new` doesn't really make a lot of sense in the context of symlinks,
      which is why this commit renames them to be called `target` and `path`.
      Patrick Steinhardt committed
  9. 25 Nov, 2019 1 commit
  10. 22 Nov, 2019 2 commits
  11. 20 Jul, 2019 1 commit
  12. 22 Jan, 2019 1 commit
  13. 01 Feb, 2018 1 commit
  14. 26 Dec, 2017 1 commit
  15. 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
  16. 28 Feb, 2017 2 commits
    • fsync parent directories when fsyncing · 1229e1c4
      When fsync'ing files, fsync the parent directory in the case where we
      rename a file into place, or create a new file, to ensure that the
      directory entry is flushed correctly.
      Edward Thomson committed
    • git_futils_writebuffer: optionally fsync · 5312621b
      Add a custom `O_FSYNC` bit (if it's not been defined by the operating
      system`) so that `git_futils_writebuffer` can optionally do an `fsync`
      when it's done writing.
      
      We call `fsync` ourselves, even on systems that define `O_FSYNC` because
      its definition is no guarantee of its actual support.  Mac, for
      instance, defines it but doesn't support it in an `open(2)` call.
      Edward Thomson committed
  17. 14 Nov, 2016 1 commit
  18. 04 Aug, 2016 2 commits
  19. 30 Oct, 2015 1 commit
  20. 19 Sep, 2015 1 commit
  21. 17 Sep, 2015 1 commit
    • git_futils_mkdir_*: make a relative-to-base mkdir · ac2fba0e
      Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter
      assumes that we own everything beneath the base, as if it were
      being called with a base of the repository or working directory,
      and is tailored towards checkout and ensuring that there is no
      bogosity beneath the base that must be cleaned up.
      
      This is (at best) slow and (at worst) unsafe in the larger context
      of a filesystem where we do not own things and cannot do things like
      unlink symlinks that are in our way.
      Edward Thomson committed
  22. 04 Feb, 2015 1 commit
  23. 20 Jan, 2015 2 commits
  24. 28 May, 2014 1 commit
  25. 17 Apr, 2014 2 commits
  26. 25 Feb, 2014 1 commit
  27. 05 Nov, 2013 2 commits
  28. 03 Oct, 2013 1 commit
    • Initial iconv hookup for precomposed unicode · 219d3457
      This hooks up git_path_direach and git_path_dirload so that they
      will take a flag indicating if directory entry names should be
      tested and converted from decomposed unicode to precomposed form.
      This code will only come into play on the Apple platform and even
      then, only when certain types of filesystems are used.
      
      This involved adding a flag to these functions which involved
      changing a lot of places in the code.
      
      This was an opportunity to do a bit of code cleanup here and there,
      for example, getting rid of the git_futils_cleanupdir_r function in
      favor of a simple flag to git_futils_rmdir_r to not remove the top
      level entry.  That ended up adding depth tracking during rmdir_r
      which led to a safety check for infinite directory recursion.  Yay.
      
      This hasn't actually been tested on the Mac filesystems where the
      issue occurs.  I still need to get test environment for that.
      Russell Belfer committed
  29. 17 Sep, 2013 3 commits
  30. 05 Sep, 2013 3 commits