1. 16 Aug, 2018 1 commit
  2. 13 Jul, 2018 1 commit
    • treewide: remove use of C++ style comments · 9994cd3f
      C++ style comment ("//") are not specified by the ISO C90 standard and
      thus do not conform to it. While libgit2 aims to conform to C90, we did
      not enforce it until now, which is why quite a lot of these
      non-conforming comments have snuck into our codebase. Do a tree-wide
      conversion of all C++ style comments to the supported C style comments
      to allow us enforcing strict C90 compliance in a later commit.
      Patrick Steinhardt committed
  3. 29 Jun, 2018 5 commits
  4. 10 Jun, 2018 1 commit
  5. 07 May, 2018 1 commit
  6. 25 Apr, 2018 1 commit
  7. 20 Apr, 2018 2 commits
    • tests: free the worktree in add_with_explicit_branch · 25100d6d
      Valgrind log:
      
      ==2711== 305 (48 direct, 257 indirect) bytes in 1 blocks are definitely lost in loss record 576 of 624
      ==2711==    at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==2711==    by 0x5E079E: git__calloc (util.h:99)
      ==2711==    by 0x5E0D21: open_worktree_dir (worktree.c:134)
      ==2711==    by 0x5E0F23: git_worktree_lookup (worktree.c:176)
      ==2711==    by 0x5E1972: git_worktree_add (worktree.c:388)
      ==2711==    by 0x551F23: test_worktree_worktree__add_with_explicit_branch (worktree.c:292)
      ==2711==    by 0x45853E: clar_run_test (clar.c:222)
      ==2711==    by 0x4587E1: clar_run_suite (clar.c:286)
      ==2711==    by 0x458B04: clar_parse_args (clar.c:362)
      ==2711==    by 0x458CAB: clar_test_run (clar.c:428)
      ==2711==    by 0x45665C: main (main.c:24)
      Etienne Samson committed
    • Fix deletion of unrelated branch on worktree · fd7b5bc3
      Signed-off-by: Sven Strickroth <email@cs-ware.de>
      Sven Strickroth committed
  8. 10 Apr, 2018 1 commit
  9. 27 Mar, 2018 1 commit
  10. 09 Feb, 2018 1 commit
    • worktree: add ability to create worktree with pre-existing branch · a22f19e6
      Currently, we always create a new branch after the new worktree's name
      when creating a worktree. In some workflows, though, the caller may want
      to check out an already existing reference instead of creating a new
      one, which is impossible to do right now.
      
      Add a new option `ref` to the options structure for adding worktrees. In
      case it is set, a branch and not already checked out by another
      worktree, we will re-use this reference instead of creating a new one.
      Patrick Steinhardt committed
  11. 05 May, 2017 2 commits
    • worktree: switch over worktree pruning to an opts structure · 883eeb5f
      The current signature of `git_worktree_prune` accepts a flags field to
      alter its behavior. This is not as flexible as we'd like it to be when
      we want to enable passing additional options in the future. As the
      function has not been part of any release yet, we are still free to
      alter its current signature. This commit does so by using our usual
      pattern of an options structure, which is easily extendable without
      breaking the API.
      Patrick Steinhardt committed
    • worktree: support creating locked worktrees · 8264a30f
      When creating a new worktree, we do have a potential race with us
      creating the worktree and another process trying to delete the same
      worktree as it is being created. As such, the upstream git project has
      introduced a flag `git worktree add --locked`, which will cause the
      newly created worktree to be locked immediately after its creation. This
      mitigates the race condition.
      
      We want to be able to mirror the same behavior. As such, a new flag
      `locked` is added to the options structure of `git_worktree_add` which
      allows the user to enable this behavior.
      Patrick Steinhardt committed
  12. 02 May, 2017 1 commit
    • worktree: introduce git_worktree_add options · a7aa73a5
      The `git_worktree_add` function currently accepts only a path and name
      for the new work tree. As we may want to expand these parameters in
      future versions without adding additional parameters to the function for
      every option, this commit introduces our typical pattern of an options
      struct. Right now, this structure is still empty, which will change with
      the next commit.
      Patrick Steinhardt committed
  13. 05 Apr, 2017 2 commits
  14. 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
  15. 15 Mar, 2017 4 commits
  16. 13 Feb, 2017 11 commits