1. 20 Feb, 2018 1 commit
    • diff_tform: fix rename detection with rewrite/delete pair · ce7080a0
      A rewritten file can either be classified as a modification of its
      contents or of a delete of the complete file followed by an addition of
      the new content. This distinction becomes important when we want to
      detect renames for rewrites. Given a scenario where a file "a" has been
      deleted and another file "b" has been renamed to "a", this should be
      detected as a deletion of "a" followed by a rename of "a" -> "b". Thus,
      splitting of the original rewrite into a delete/add pair is important
      here.
      
      This splitting is represented by a flag we can set at the current delta.
      While the flag is already being set in case we want to break rewrites,
      we do not do so in case where the `GIT_DIFF_FIND_RENAMES_FROM_REWRITES`
      flag is set. This can trigger an assert when we try to match the source
      and target deltas.
      
      Fix the issue by setting the `GIT_DIFF_FLAG__TO_SPLIT` flag at the delta
      when it is a rename target and `GIT_DIFF_FIND_RENAMES_FROM_REWRITES` is
      set.
      Patrick Steinhardt committed
  2. 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
  3. 09 Feb, 2017 1 commit
  4. 29 Dec, 2016 1 commit
  5. 26 May, 2016 1 commit
  6. 11 Mar, 2016 1 commit
    • diff_tform: fix potential NULL pointer access · 1a8c11f4
      When the user passes in a diff which has no repository associated
      we may call `git_config__get_int_force` with a NULL-pointer
      configuration. Even though `git_config__get_int_force` is
      designed to swallow errors, it is not intended to be called with
      a NULL pointer configuration.
      
      Fix the issue by only calling `git_config__get_int_force` only
      when configuration could be retrieved from the repository.
      Patrick Steinhardt committed
  7. 23 Feb, 2016 1 commit
    • diff_tform: fix potential NULL pointer access · 32f07984
      The `normalize_find_opts` function in theory allows for the
      incoming diff to have no repository. When the caller does not
      pass in diff find options or if the GIT_DIFF_FIND_BY_CONFIG value
      is set, though, we try to derive the configuration from the
      diff's repository configuration without first verifying that the
      repository is actually set to a non-NULL value.
      
      Fix this issue by explicitly checking if the repository is set
      and if it is not, fall back to a default value of
      GIT_DIFF_FIND_RENAMES.
      Patrick Steinhardt committed
  8. 28 Oct, 2015 1 commit
  9. 23 Jun, 2015 4 commits
  10. 10 Jun, 2015 1 commit
  11. 30 Mar, 2015 1 commit
  12. 03 Mar, 2015 1 commit
  13. 13 Feb, 2015 2 commits
  14. 14 Jan, 2015 1 commit
  15. 27 Oct, 2014 1 commit
  16. 01 Oct, 2014 1 commit
  17. 20 May, 2014 1 commit
  18. 02 May, 2014 1 commit
  19. 24 Feb, 2014 2 commits
  20. 25 Jan, 2014 1 commit
  21. 22 Jan, 2014 1 commit
  22. 12 Dec, 2013 2 commits
  23. 11 Dec, 2013 3 commits
    • Add git_vector_free_all · fcd324c6
      There are a lot of places that we call git__free on each item in
      a vector and then call git_vector_free on the vector itself.  This
      just wraps that up into one convenient helper function.
      Russell Belfer committed
    • 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
    • Check version earlier · 5a52d6be
      Ben Straub committed
  24. 06 Dec, 2013 1 commit
  25. 05 Dec, 2013 2 commits
  26. 02 Dec, 2013 3 commits
  27. 01 Nov, 2013 2 commits
    • More tests and fixed for merging reversed diffs · e7c85120
      There were a lot more cases to deal with to make sure that our
      merged (i.e. workdir-to-tree-to-index) diffs were matching the
      output of core Git.
      Russell Belfer committed
    • Fix some of the glaring errors in GIT_DIFF_REVERSE · 3940310e
      These changes fix the basic problem with GIT_DIFF_REVERSE being
      broken for text diffs.  The reversed diff entries were getting
      added to the git_diff correctly, but some of the metadata was kept
      incorrectly in a way that prevented the text diffs from being
      generated correctly.  Once I fixed that, it became clear that it
      was not possible to merge reversed diffs correctly.  This has a
      first pass at fixing that problem.  We probably need more tests
      to make sure that is really fixed thoroughly.
      Russell Belfer committed
  28. 21 Oct, 2013 1 commit