1. 12 Jul, 2022 1 commit
  2. 07 Jul, 2022 3 commits
  3. 12 Apr, 2022 1 commit
  4. 11 Apr, 2022 1 commit
  5. 23 Feb, 2022 2 commits
  6. 18 Jan, 2022 1 commit
  7. 22 Nov, 2021 1 commit
  8. 09 Nov, 2021 9 commits
  9. 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
  10. 09 Sep, 2021 1 commit
  11. 28 Apr, 2021 2 commits
    • path: don't join paths in git_path_find_dir · 1016ad4f
      Let `git_path_find_dir` simply take a `git_buf` that contains a
      directory or a file, instead of trying to both join a path AND then deal
      with prettifying it or its basename.  This allows consumers to join
      paths themselves (and apply any necessary rules - like fitting within
      MAX_PATH).
      Edward Thomson committed
    • path: introduce ondisk and workdir path validation · dc1ba018
      Introduce `git_path_validate_filesystem` which validates (absolute) on-disk
      paths and `git_path_validate_workdir` to perform validations on (absolute)
      working directory paths.  These functions are useful as there may be system
      limitations on on-disk paths, particularly on Windows (for example,
      enforcing MAX_PATH).
      
      For working directory paths, these limitations may be per-repository, based
      on the `core.longpaths` configuration setting.
      Edward Thomson committed
  12. 14 Apr, 2021 1 commit
  13. 27 Nov, 2020 1 commit
  14. 13 Aug, 2019 1 commit
    • config: validate ownership of C:\ProgramData\Git\config before using it · cb1439c9
      When the VirtualStore feature is in effect, it is safe to let random
      users write into C:\ProgramData because other users won't see those
      files. This seemed to be the case when we introduced support for
      C:\ProgramData\Git\config.
      
      However, when that feature is not in effect (which seems to be the case
      in newer Windows 10 versions), we'd rather not use those files unless
      they come from a trusted source, such as an administrator.
      
      This change imitates the strategy chosen by PowerShell's native OpenSSH
      port to Windows regarding host key files: if a system file is owned
      neither by an administrator, a system account, or the current user, it
      is ignored.
      Johannes Schindelin committed
  15. 20 Jul, 2019 1 commit
    • path: extract function to check whether a path supports symlinks · ded77bb1
      When initializing a repository, we need to check whether its working
      directory supports symlinks to correctly set the initial value of the
      "core.symlinks" config variable. The code to check the filesystem is
      reusable in other parts of our codebase, like for example in our tests
      to determine whether certain tests can be expected to succeed or not.
      
      Extract the code into a new function `git_path_supports_symlinks` to
      avoid duplicate implementations. Remove a duplicate implementation in
      the repo test helper code.
      Patrick Steinhardt committed
  16. 15 Oct, 2018 1 commit
  17. 01 Jun, 2018 1 commit
    • path: unify `git_path_is_*` APIs · 92159bd4
      Right now, there's quite a lot of different function calls to determine
      whether a path component matches a specific name after normalization
      from the filesystem. We have a function for each of {gitattributes,
      gitmodules, gitignore} multiplicated with {generic, NTFS, HFS} checks.
      In the long time, this is unmaintainable in case there are e.g. new
      filesystems with specific semantics, blowing up the number of functions
      we need to implement.
      
      Replace all functions with a simple `git_path_is_gitfile` function,
      which accepts an enum pointing out the filename that is to be checked
      against as well as the filesystem normalizations to check for. This
      greatly simplifies implementation at the expense of the caller having to
      invoke a somewhat longer function call.
      Patrick Steinhardt committed
  18. 23 May, 2018 1 commit
  19. 22 May, 2018 2 commits
  20. 18 May, 2018 1 commit
  21. 09 Oct, 2017 2 commits
  22. 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
  23. 26 May, 2016 1 commit
  24. 24 Mar, 2016 1 commit
  25. 17 Feb, 2016 1 commit
    • index: allow read of index w/ illegal entries · 318b825e
      Allow `git_index_read` to handle reading existing indexes with
      illegal entries.  Allow the low-level `git_index_add` to add
      properly formed `git_index_entry`s even if they contain paths
      that would be illegal for the current filesystem (eg, `AUX`).
      Continue to disallow `git_index_add_bypath` from adding entries
      that are illegal universally illegal (eg, `.git`, `foo/../bar`).
      Edward Thomson committed
  26. 17 Sep, 2015 1 commit