1. 12 Feb, 2023 2 commits
  2. 12 Apr, 2022 1 commit
  3. 23 Feb, 2022 1 commit
  4. 15 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. 04 Sep, 2021 1 commit
    • common: support custom repository extensions · a24e656a
      Allow users to specify additional repository extensions that they want
      to support.  For example, callers can specify that they support
      `preciousObjects` and then may open repositories that support
      `extensions.preciousObjects`.
      
      Similarly, callers may opt out of supporting extensions that the library
      itself supports.
      Edward Thomson committed
  7. 28 Apr, 2021 2 commits
    • repo: introduce git_repository_workdir_path · 50e01216
      Add a simple accessor for workdir paths to get an absolute on-disk path
      given a repository and a relative path within it.  This is useful to
      avoid copy-pasta `git_buf_joinpath` and to ensure that we validate
      working directory paths while honoring `core.longpaths` settings.
      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
  8. 20 Dec, 2020 1 commit
  9. 06 Dec, 2020 1 commit
  10. 03 Aug, 2020 1 commit
  11. 12 Jul, 2020 2 commits
  12. 10 Dec, 2019 1 commit
  13. 18 Jul, 2019 1 commit
  14. 14 Feb, 2019 1 commit
  15. 22 Jan, 2019 1 commit
  16. 18 Nov, 2018 1 commit
  17. 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
  18. 08 Jun, 2017 1 commit
    • settings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION` · 6c23704d
      Initially, the setting has been solely used to enable the use of
      `fsync()` when creating objects. Since then, the use has been extended
      to also cover references and index files. As the option is not yet part
      of any release, we can still correct this by renaming the option to
      something more sensible, indicating not only correlation to objects.
      
      This commit renames the option to `GIT_OPT_ENABLE_FSYNC_GITDIR`. We also
      move the variable from the object to repository source code.
      Patrick Steinhardt committed
  19. 05 Apr, 2017 1 commit
  20. 02 Mar, 2017 1 commit
  21. 13 Feb, 2017 4 commits
  22. 20 Jan, 2017 1 commit
    • Allow for caching of submodules. · 4d99c4cf
      Added `git_repository_submodule_cache_all` to initialze a cache of
      submodules on the repository so that operations looking up N
      submodules are O(N) and not O(N^2).  Added a
      `git_repository_submodule_cache_clear` function to remove the cache.
      
      Also optimized the function that loads all submodules as it was itself
      O(N^2) w.r.t the number of submodules, having to loop through the
      `.gitmodules` file once per submodule.  I changed it to process the
      `.gitmodules` file once, into a map.
      
      Signed-off-by: David Turner <dturner@twosigma.com>
      Brock Peabody committed
  23. 29 Dec, 2016 1 commit
  24. 22 Jun, 2015 1 commit
    • submodule: remove the per-repo cache · dfda2f68
      Having this cache and giving them out goes against our multithreading
      guarantees and it makes it impossible to use submodules in a
      multi-threaded environment, as any thread can ask for a refresh which
      may reallocate some string in the submodule struct which we've accessed
      in a different one via a getter.
      
      This makes the submodules behave more like remotes, where each object is
      created upon request and not shared except explicitly by the user. This
      means that some tests won't pass yet, as they assume they can affect the
      submodule objects in the cache and that will affect later operations.
      Carlos Martín Nieto committed
  25. 03 Mar, 2015 1 commit
    • Remove the signature from ref-modifying functions · 659cf202
      The signature for the reflog is not something which changes
      dynamically. Almost all uses will be NULL, since we want for the
      repository's default identity to be used, making it noise.
      
      In order to allow for changing the identity, we instead provide
      git_repository_set_ident() and git_repository_ident() which allow a user
      to override the choice of signature.
      Carlos Martín Nieto committed
  26. 27 Feb, 2015 1 commit
  27. 03 Feb, 2015 1 commit
    • attrcache: don't re-read attrs during checkout · 9f779aac
      During checkout, assume that the .gitattributes files aren't
      modified during the checkout.  Instead, create an "attribute session"
      during checkout.  Assume that attribute data read in the same
      checkout "session" hasn't been modified since the checkout started.
      (But allow subsequent checkouts to invalidate the cache.)
      
      Further, cache nonexistent git_attr_file data even when .gitattributes
      files are not found to prevent re-scanning for nonexistent files.
      Edward Thomson committed
  28. 17 Dec, 2014 1 commit
  29. 16 Dec, 2014 1 commit
    • checkout: disallow bad paths on win32 · a64119e3
      Disallow:
       1. paths with trailing dot
       2. paths with trailing space
       3. paths with trailing colon
       4. paths that are 8.3 short names of .git folders ("GIT~1")
       5. paths that are reserved path names (COM1, LPT1, etc).
       6. paths with reserved DOS characters (colons, asterisks, etc)
      
      These paths would (without \\?\ syntax) be elided to other paths - for
      example, ".git." would be written as ".git".  As a result, writing these
      paths literally (using \\?\ syntax) makes them hard to operate with from
      the shell, Windows Explorer or other tools.  Disallow these.
      Edward Thomson committed
  30. 05 Dec, 2014 1 commit
  31. 27 Oct, 2014 1 commit
  32. 13 May, 2014 1 commit
  33. 17 Apr, 2014 1 commit
  34. 08 Apr, 2014 1 commit