1. 28 Apr, 2021 1 commit
    • 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
  2. 20 Dec, 2020 1 commit
  3. 06 Dec, 2020 1 commit
  4. 28 Nov, 2020 1 commit
  5. 20 Jul, 2019 1 commit
  6. 18 Jul, 2019 1 commit
  7. 18 Nov, 2018 1 commit
  8. 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
  9. 02 Mar, 2017 1 commit
  10. 11 Mar, 2016 1 commit
    • config_cache: check return value of `git_config__lookup_entry` · 13c371dc
      Callers of `git_config__cvar` already handle the case where the
      function returns an error due to a failed configuration variable
      lookup, but we are actually swallowing errors when calling
      `git_config__lookup_entry` inside of the function.
      
      Fix this by returning early when `git_config__lookup_entry`
      returns an error. As we call `git_config__lookup_entry` with
      `no_errors == false` which leads us to call `get_entry` with
      `GET_NO_MISSING` we will not return early when the lookup fails
      due to a missing entry. Like this we are still able to set the
      default value of the cvar and exit successfully.
      Patrick Steinhardt committed
  11. 03 Mar, 2015 1 commit
    • config: borrow refcounted references · 9a97f49e
      This changes the get_entry() method to return a refcounted version of
      the config entry, which you have to free when you're done.
      
      This allows us to avoid freeing the memory in which the entry is stored
      on a refresh, which may happen at any time for a live config.
      
      For this reason, get_string() has been forbidden on live configs and a
      new function get_string_buf() has been added, which stores the string in
      a git_buf which the user then owns.
      
      The functions which parse the string value takea advantage of the
      borrowing to parse safely and then release the entry.
      Carlos Martín Nieto committed
  12. 17 Dec, 2014 1 commit
  13. 30 May, 2014 1 commit
  14. 13 May, 2014 1 commit
  15. 08 Apr, 2014 1 commit
  16. 11 Dec, 2013 1 commit
    • Add config read fns with controlled error behavior · 9f77b3f6
      This adds `git_config__lookup_entry` which will look up a key in
      a config and return either the entry or NULL if the key was not
      present.  Optionally, it can either suppress all errors or can
      return them (although not finding the key is not an error for this
      function).  Unlike other accessors, this does not normalize the
      config key string, so it must only be used when the key is known
      to be in normalized form (i.e. all lower-case before the first dot
      and after the last dot, with no invalid characters).
      
      This also adds three high-level helper functions to look up config
      values with no errors and a fallback value.  The three functions
      are for string, bool, and int values, and will resort to the
      fallback value for any error that arises.  They are:
      
      * `git_config__get_string_force`
      * `git_config__get_bool_force`
      * `git_config__get_int_force`
      
      None of them normalize the config `key` either, so they can only
      be used for internal cases where the key is known to be in normal
      format.
      Russell Belfer committed
  17. 03 Oct, 2013 1 commit
  18. 23 Apr, 2013 1 commit
    • Add configs to repo config cache · ab01cbd4
      This adds a bunch of additional config values to the repository
      config value cache and makes it easier to add a simple boolean
      config without creating enum values for each possible setting.
      
      Also, this fixes a bug in git_config_refresh where the config
      cache was not being cleared which could lead to potential
      incorrect values.
      
      The work to start using the new cached configs will come in the
      next couple of commits...
      Russell Belfer committed
  19. 08 Jan, 2013 1 commit
  20. 03 Dec, 2012 1 commit
  21. 17 May, 2012 3 commits
  22. 25 Apr, 2012 1 commit
  23. 02 Mar, 2012 1 commit