1. 21 Mar, 2017 4 commits
  2. 20 Mar, 2017 9 commits
  3. 15 Mar, 2017 4 commits
  4. 14 Mar, 2017 7 commits
    • Merge pull request #4146 from pks-t/pks/winhttp-errors · 13bf4d7f
      winhttp: disambiguate error messages when sending requests
      Patrick Steinhardt committed
    • submodule: catch when submodule is not staged on update · 32ecc98e
      When calling `git_submodule_update` on a submodule, we have to retrieve
      the ID of the submodule entry in the index. If the function is called on
      a submodule which is only partly initialized, the submodule entry may
      not be added to the index yet. This leads to an assert when trying to
      look up the blob later on.
      
      Fix the issue by checking if the index actually holds the submodule's
      ID and erroring out if it does not.
      Patrick Steinhardt committed
    • diff_parse: correctly set options for parsed diffs · c0eba379
      The function `diff_parsed_alloc` allocates and initializes a
      `git_diff_parsed` structure. This structure also contains diff options.
      While we initialize its flags, we fail to do a real initialization of
      its values. This bites us when we want to actually use the generated
      diff as we do not se the option's version field, which is required to
      operate correctly.
      
      Fix the issue by executing `git_diff_init_options` on the embedded
      struct.
      Patrick Steinhardt committed
    • patch_parse: fix parsing minimal trailing diff line · ad5a909c
      In a diff, the shortest possible hunk with a modification (that is, no
      deletion) results from a file with only one line with a single character
      which is removed. Thus the following hunk
      
          @@ -1 +1 @@
          -a
          +
      
      is the shortest valid hunk modifying a line. The function parsing the
      hunk body though assumes that there must always be at least 4 bytes
      present to make up a valid hunk, which is obviously wrong in this case.
      The absolute minimum number of bytes required for a modification is
      actually 2 bytes, that is the "+" and the following newline. Note: if
      there is no trailing newline, the assumption will not be offended as the
      diff will have a line "\ No trailing newline" at its end.
      
      This patch fixes the issue by lowering the amount of bytes required.
      Patrick Steinhardt committed
    • patch_generate: move `git_diff_foreach` to diff.c · 62a2fc06
      Now that the `git_diff_foreach` function does not depend on internals of
      the `git_patch_generated` structure anymore, we can easily move it to
      the actual diff code.
      Patrick Steinhardt committed
    • patch_generate: fix `git_diff_foreach` only working with generated diffs · ace3508f
      The current logic of `git_diff_foreach` makes the assumption that all
      diffs passed in are actually derived from generated diffs. With these
      assumptions we try to derive the actual diff by inspecting either the
      working directory files or blobs of a repository. This obviously cannot
      work for diffs parsed from a file, where we do not necessarily have a
      repository at hand.
      
      Since the introduced split of parsed and generated patches, there are
      multiple functions which help us to handle patches generically, being
      indifferent from where they stem from. Use these functions and remove
      the old logic specific to generated patches. This allows re-using the
      same code for invoking the callbacks on the deltas.
      Patrick Steinhardt committed
    • patch_generate: remove duplicated logic · 41019152
      Under the existing logic, we try to load patch contents differently,
      depending on whether the patch files stem from the working directory or
      not. But actually, the executed code paths are completely equal to each
      other -- so we were always the code despite the condition.
      
      Remove the condition altogether and conflate both code paths.
      Patrick Steinhardt committed
  5. 11 Mar, 2017 2 commits
  6. 09 Mar, 2017 3 commits
  7. 06 Mar, 2017 3 commits
  8. 03 Mar, 2017 8 commits