1. 05 Apr, 2017 2 commits
  2. 03 Apr, 2017 1 commit
  3. 22 Mar, 2017 1 commit
  4. 20 Mar, 2017 1 commit
  5. 17 Mar, 2017 5 commits
    • submodule: resolve URLs relative to main worktree · b0c9bc92
      It is possible to specify submodule URLs relative to the repository
      location. E.g. having a submodule with URL "../submodule" will look for
      the submodule at "repo/../submodule".
      
      With the introduction of worktrees, though, we cannot simply resolve the
      URL relative to the repository location itself. If the repository for
      which a URL is to be resolved is a working tree, we have to resolve the
      URL relative to the parent's repository path. Otherwise, the URL would
      change depending on where the working tree is located.
      
      Fix this by special-casing when we have a working tree while getting the
      URL base.
      Patrick Steinhardt committed
    • refdb: create references in commondir · 097f0105
      References for a repository are usually created inside of its gitdir.
      When using worktrees, though, these references are not to be created
      inside the worktree gitdir, but instead inside the gitdir of its parent
      repository, which is the commondir. Like this, branches will still be
      available after the worktree itself has been deleted.
      
      The filesystem refdb currently still creates new references inside of
      the gitdir. Fix this and have it create references in commondir.
      Patrick Steinhardt committed
    • worktree: write resolved paths into link files · 8f154be3
      The three link files "worktree/.git", ".git/worktrees/<name>/commondir"
      and ".git/worktrees/<name>/gitdir" should always contain absolute and
      resolved paths. Adjust the logic creating new worktrees to first use
      `git_path_prettify_dir` before writing out these files, so that paths
      are resolved first.
      Patrick Steinhardt committed
    • worktree: parent path should point to the working dir · 20a368e2
      The working tree's parent path should not point to the parent's gitdir,
      but to the parent's working directory. Pointing to the gitdir would not
      make any sense, as the parent's working directory is actually equal to
      both repository's common directory.
      
      Fix the issue.
      Patrick Steinhardt committed
    • worktree: implement `git_worktree_open_from_repository` · 3017ba94
      While we already provide functionality to look up a worktree from a
      repository, we cannot do so the other way round. That is given a
      repository, we want to look up its worktree if it actually exists.
      Getting the worktree of a repository is useful when we want to get
      certain meta information like the parent's location, getting the locked
      status, etc.
      Patrick Steinhardt committed
  6. 15 Mar, 2017 4 commits
  7. 14 Mar, 2017 3 commits
    • 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: 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
  8. 09 Mar, 2017 1 commit
  9. 06 Mar, 2017 1 commit
  10. 03 Mar, 2017 3 commits
  11. 02 Mar, 2017 1 commit
  12. 01 Mar, 2017 1 commit
  13. 28 Feb, 2017 8 commits
  14. 25 Feb, 2017 3 commits
  15. 17 Feb, 2017 5 commits