1. 23 Feb, 2022 1 commit
  2. 09 Nov, 2021 1 commit
  3. 28 Sep, 2018 1 commit
    • config: rename "config_file.h" to "config_backend.h" · b944e137
      The header "config_file.h" has a list of inline-functions to access the
      contents of a config backend without directly messing with the struct's
      function pointers. While all these functions are called
      "git_config_file_*", they are in fact completely backend-agnostic and
      don't care whether it is a file or not. Rename all the function to
      instead be backend-agnostic versions called "git_config_backend_*" and
      rename the header to match.
      Patrick Steinhardt committed
  4. 09 Oct, 2017 1 commit
    • config: pass repository when opening config files · 529e873c
      Our current configuration logic is completely oblivious of any
      repository, but only cares for actual file paths. Unfortunately, we are
      forced to break this assumption by the introduction of conditional
      includes, which are evaluated in the context of a repository. Right now,
      only one conditional exists with "gitdir:" -- it will only include the
      configuration if the current repository's git directory matches the
      value passed to "gitdir:".
      
      To support these conditionals, we have to break our API and make the
      repository available when opening a configuration file. This commit
      extends the `open` call of configuration backends to include another
      repository and adjusts existing code to have it available. This includes
      the user-visible functions `git_config_add_file_ondisk` and
      `git_config_add_backend`.
      Patrick Steinhardt committed
  5. 05 Jul, 2017 1 commit
    • tests: config: fix missing declaration causing error · 1f7af277
      On systems where we pull in our distributed version of the regex
      library, all tests in config::readonly fail. This error is actually
      quite interesting: the test suite is unable to find the declaration of
      `git_path_exists` and assumes it has a signature of `int
      git_path_exists(const char *)`. But actually, it has a `bool` return
      value. Due to this confusion, some wrong conversion is done by the
      compiler and the `cl_assert(!git_path_exists("file"))` checks
      erroneously fail, even when the function does in fact return the correct
      value.
      
      The error is actually introduced by 56893bb9 (cmake: consistently use
      TARGET_INCLUDE_DIRECTORIES if available, 2017-06-28), unfortunately
      introduced by myself. Due to the delayed addition of include
      directories, we will now find the "config.h" header inside of the
      "deps/regex" directory instead of inside the "src/" directory, where it
      should be. As such, we are missing definitions for the
      `git_config_file__ondisk` and `git_path_exists` symbols.
      
      The correct fix here would be to fix the order in which include search
      directories are added. But due to the current restructuring of
      CMakeBuild.txt, I'm refraining from doing so and delay the proper fix a
      bit. Instead, we paper over the issue by explicitly including "path.h"
      to fix its prototype. This ignores the issue that
      `git_config_file__ondisk` is undeclared, as its signature is correctly
      identified by the compiler.
      Patrick Steinhardt committed
  6. 26 Apr, 2017 1 commit