1. 16 Jun, 2021 1 commit
  2. 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
  3. 25 Nov, 2019 1 commit
  4. 22 Nov, 2019 2 commits
  5. 20 Jul, 2019 1 commit
  6. 22 Jan, 2019 1 commit
  7. 01 Feb, 2018 1 commit
  8. 26 Dec, 2017 1 commit
  9. 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
  10. 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
  11. 14 Nov, 2016 1 commit
  12. 04 Aug, 2016 2 commits
  13. 30 Oct, 2015 1 commit
  14. 19 Sep, 2015 1 commit
  15. 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
  16. 04 Feb, 2015 1 commit
  17. 20 Jan, 2015 2 commits
  18. 28 May, 2014 1 commit
  19. 17 Apr, 2014 2 commits
  20. 25 Feb, 2014 1 commit
  21. 05 Nov, 2013 2 commits
  22. 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
  23. 17 Sep, 2013 3 commits
  24. 05 Sep, 2013 3 commits
  25. 23 Jul, 2013 1 commit
  26. 11 Jul, 2013 1 commit
  27. 20 May, 2013 2 commits
    • Add more diff rename detection tests · 4742148d
      This adds a bunch more rename detection tests including checks
      vs the working directory, the new exact match options, some more
      whitespace variants, etc.
      
      This also adds a git_futils_writebuffer helper function and uses
      it in checkout.  This is mainly added because I wanted an easy
      way to write out a git_buf to disk inside my test code.
      Russell Belfer committed
    • More git_diff_find_similar improvements · 9be5be47
      - Add new GIT_DIFF_FIND_EXACT_MATCH_ONLY flag to do similarity
        matching without using the similarity metric (i.e. only compare
        the SHA).
      - Clean up the similarity measurement code to more rigorously
        distinguish between files that are not similar and files that
        are not comparable (previously, a 0 could either mean that the
        files could not be compared or that they were totally different)
      - When splitting a MODIFIED file into a DELETE/ADD pair, actually
        make a DELETED/UNTRACKED pair if the right side of the diff is
        from the working directory.  This prevents an odd mix of ADDED
        and UNTRACKED files on workdir diffs.
      Russell Belfer committed
  28. 18 Mar, 2013 1 commit
    • Switch search paths to classic delimited strings · 41954a49
      This switches the APIs for setting and getting the global/system
      search paths from using git_strarray to using a simple string with
      GIT_PATH_LIST_SEPARATOR delimited paths, just as the environment
      PATH variable would contain.  This makes it simpler to get and set
      the value.
      
      I also added code to expand "$PATH" when setting a new value to
      embed the old value of the path.  This means that I no longer
      require separate actions to PREPEND to the value.
      Russell Belfer committed
  29. 15 Mar, 2013 1 commit
    • Implement global/system file search paths · 5540d947
      The goal of this work is to expose the search logic for "global",
      "system", and "xdg" files through the git_libgit2_opts() interface.
      
      Behind the scenes, I changed the logic for finding files to have a
      notion of a git_strarray that represents a search path and to store
      a separate search path for each of the three tiers of config file.
      For each tier, I implemented a function to initialize it to default
      values (generally based on environment variables), and then general
      interfaces to get it, set it, reset it, and prepend new directories
      to it.
      
      Next, I exposed these interfaces through the git_libgit2_opts
      interface, reusing the GIT_CONFIG_LEVEL_SYSTEM, etc., constants
      for the user to control which search path they were modifying.
      There are alternative designs for the opts interface / argument
      ordering, so I'm putting this phase out for discussion.
      
      Additionally, I ended up doing a little bit of clean up regarding
      attr.h and attr_file.h, adding a new attrcache.h so the other two
      files wouldn't have to be included in so many places.
      Russell Belfer committed