1. 20 Jul, 2019 1 commit
  2. 15 Jun, 2019 1 commit
  3. 22 Jan, 2019 1 commit
  4. 04 Jan, 2019 1 commit
  5. 01 Dec, 2018 1 commit
  6. 09 Aug, 2018 1 commit
    • diff: fix OOM on AIX when finding similar deltas in empty diff · c65568d8
      The function `git_diff_find_similar` keeps a function of cache
      similarity metrics signatures, whose size depends on the number of
      deltas passed in via the `diff` parameter. In case where the diff is
      empty and thus doesn't have any deltas at all, we may end up allocating
      this cache via a call to `git__calloc(0, sizeof(void *))`. At least on
      AIX, allocating 0 bytes will result in a `NULL` pointer being returned,
      which causes us to erroneously return an OOM error.
      
      Fix this situation by simply returning early in case where we are being
      passed an empty diff, as we cannot find any similarities in that case
      anyway.
      Patrick Steinhardt committed
  7. 10 Jun, 2018 1 commit
  8. 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
  9. 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
  10. 09 Feb, 2017 1 commit
  11. 29 Dec, 2016 1 commit
  12. 26 May, 2016 1 commit
  13. 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
  14. 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
  15. 28 Oct, 2015 1 commit
  16. 23 Jun, 2015 4 commits
  17. 10 Jun, 2015 1 commit
  18. 30 Mar, 2015 1 commit
  19. 03 Mar, 2015 1 commit
  20. 13 Feb, 2015 2 commits
  21. 14 Jan, 2015 1 commit
  22. 27 Oct, 2014 1 commit
  23. 01 Oct, 2014 1 commit
  24. 20 May, 2014 1 commit
  25. 02 May, 2014 1 commit
  26. 24 Feb, 2014 2 commits
  27. 25 Jan, 2014 1 commit
  28. 22 Jan, 2014 1 commit
  29. 12 Dec, 2013 2 commits
  30. 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
  31. 06 Dec, 2013 1 commit
  32. 05 Dec, 2013 1 commit