1. 10 Apr, 2023 1 commit
  2. 15 Jun, 2022 1 commit
  3. 10 Apr, 2022 1 commit
  4. 13 Mar, 2022 1 commit
  5. 23 Feb, 2022 1 commit
  6. 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
  7. 27 Nov, 2020 1 commit
  8. 25 Nov, 2020 1 commit
  9. 17 Jun, 2020 4 commits
  10. 09 Jun, 2020 1 commit
  11. 26 Mar, 2020 1 commit
    • patch: correctly handle mode changes for renames · 5f47cb48
      When generating a patch for a renamed file whose mode bits have changed
      in addition to the rename, then we currently fail to parse the generated
      patch. Furthermore, when generating a diff we output mode bits after the
      similarity metric, which is different to how upstream git handles it.
      
      Fix both issues by adding another state transition that allows
      similarity indices after mode changes and by printing mode changes
      before the similarity index.
      Patrick Steinhardt committed
  12. 19 Nov, 2019 2 commits
  13. 20 Jul, 2019 1 commit
  14. 18 Jul, 2019 1 commit
  15. 15 Jun, 2019 1 commit
  16. 22 Jan, 2019 1 commit
  17. 10 Jun, 2018 1 commit
  18. 05 Apr, 2018 1 commit
  19. 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
  20. 29 Dec, 2016 1 commit
  21. 05 Sep, 2016 1 commit
  22. 02 Sep, 2016 1 commit
    • diff_print: change test for skipping binary printing · f4e3dae7
      Instead of skipping printing a binary diff when there is no data, skip
      printing when we have a status of `UNMODIFIED`.  This is more in-line
      with our internal data model and allows us to expand the notion of
      binary data.
      
      In the future, there may have no data because the files were unmodified
      (there was no data to produce) or it may have no data because there was
      no data given to us in a patch.  We want to treat these cases
      separately.
      Edward Thomson committed
  23. 26 Jun, 2016 1 commit
  24. 26 May, 2016 12 commits
  25. 23 Feb, 2016 1 commit
    • diff_print: assert patch is non-NULL · be8479c9
      When invoking `diff_print_info_init_frompatch` it is obvious that
      the patch should be non-NULL. We explicitly check if the variable
      is set and continue afterwards, happily dereferencing the
      potential NULL-pointer.
      
      Fix this by instead asserting that patch is set. This also
      silences Coverity.
      Patrick Steinhardt committed