1. 04 Apr, 2017 3 commits
    • path: short-circuit `git_path_apply_relative` on error · a76d7502
      Short-circuit the call to `git_path_resolve_relative` in case
      `git_buf_joinpath` returns an error. While this does not fix any
      immediate errors, the resulting code is easier to read and handles
      potential new error conditions raised by `git_buf_joinpath`.
      Patrick Steinhardt committed
    • path: handle error returned by `git_buf_joinpath` · cffd616a
      In the `_check_dir_contents` function, we first allocate memory for
      joining the directory and subdirectory together and afterwards use
      `git_buf_joinpath`. While this function in fact should not fail as
      memory is already allocated, err on the safe side and check for returned
      errors.
      Patrick Steinhardt committed
    • config_file: handle errors other than OOM while parsing section headers · 4467aeac
      The current code in `parse_section_header_ext` is only prepared to
      properly handle out-of-memory conditions for the `git_buf` structure.
      While very unlikely and probably caused by a programming error, it is
      also possible to run into error conditions other than out-of-memory
      previous to reaching the actual parsing loop. In these cases, we will
      run into undefined behavior as the `rpos` variable is only initialized
      after these triggerable errors, but we use it in the cleanup-routine.
      
      Fix the issue by unifying the function's cleanup code with an
      `end_error` section, which will not use the `rpos` variable.
      Patrick Steinhardt committed
  2. 28 Mar, 2017 1 commit
  3. 24 Mar, 2017 3 commits
  4. 23 Mar, 2017 6 commits
  5. 22 Mar, 2017 6 commits
  6. 21 Mar, 2017 7 commits
  7. 20 Mar, 2017 11 commits
  8. 17 Mar, 2017 3 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