- 16 Aug, 2018 1 commit
-
-
The documentation states that git_worktree_unlock returns 0 on success, and 1 on success if the worktree wasn't locked. Turns out we were returning 0 in any of those cases.
Etienne Samson committed
-
- 29 Jun, 2018 3 commits
-
-
Etienne Samson committed
-
Etienne Samson committed
-
Etienne Samson committed
-
- 10 Jun, 2018 1 commit
-
-
Patrick Steinhardt committed
-
- 07 May, 2018 1 commit
-
-
Etienne Samson committed
-
- 25 Apr, 2018 1 commit
-
-
Matt Keeler committed
-
- 20 Apr, 2018 1 commit
-
-
Etienne Samson committed
-
- 03 Mar, 2018 1 commit
-
-
Jacques Germishuys committed
-
- 02 Mar, 2018 1 commit
-
-
Jacques Germishuys committed
-
- 09 Feb, 2018 1 commit
-
-
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
-
- 03 Jul, 2017 1 commit
-
-
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
-
- 08 Jun, 2017 1 commit
-
-
Patrick Steinhardt committed
-
- 05 May, 2017 2 commits
-
-
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 -
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
-
- 02 May, 2017 1 commit
-
-
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
-
- 24 Mar, 2017 1 commit
-
-
Patrick Steinhardt committed
-
- 17 Mar, 2017 7 commits
-
-
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 -
Patrick Steinhardt committed
-
When creating a new worktree, we have to set up the initial data structures. Next to others, this also includes the HEAD pseudo-ref. We currently set it to the worktree respectively branch name, which is actually not fully qualified. Use the fully qualified branch name instead.
Patrick Steinhardt committed -
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 -
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 -
Separate the logic of finding the worktree directory of a repository and actually opening the working tree's directory. This is a preparatory step for opening the worktree structure of a repository itself.
Patrick Steinhardt committed -
This will be used in later commits, where it becomes cumbersome to always pass in a buffer.
Patrick Steinhardt committed
-
- 13 Feb, 2017 8 commits
-
-
Patrick Steinhardt committed
-
When opening a worktree via the gitdir of its parent repository we fail to correctly set up the worktree's working directory. The problem here is two-fold: we first fail to see that the gitdir actually is a gitdir of a working tree and then subsequently fail to determine the working tree location from the gitdir. The first problem of not noticing a gitdir belongs to a worktree can be solved by checking for the existence of a `gitdir` file in the gitdir. This file points back to the gitlink file located in the working tree's working directory. As this file only exists for worktrees, it should be sufficient indication of the gitdir belonging to a worktree. The second problem, that is determining the location of the worktree's working directory, can then be solved by reading the `gitdir` file in the working directory's gitdir. When we now resolve relative paths and strip the final `.git` component, we have the actual worktree's working directory location.
Patrick Steinhardt committed -
Implement the `git_worktree_prune` function. This function can be used to delete working trees from a repository. According to the flags passed to it, it can either delete the working tree's gitdir only or both gitdir and the working directory.
Patrick Steinhardt committed -
Working trees support locking by creating a file `locked` inside the tree's gitdir with an optional reason inside. Support this feature by adding functions to get and set the locking status.
Patrick Steinhardt committed -
Implement the `git_worktree_add` function which can be used to create new working trees for a given repository.
Patrick Steinhardt committed -
Add a new function that checks wether a given `struct git_worktree` is valid. The validation includes checking if the gitdir, parent directory and common directory are present.
Patrick Steinhardt committed -
Introduce a new `struct git_worktree`, which holds information about a possible working tree connected to a repository. Introduce functions to allow opening working trees for a repository.
Patrick Steinhardt committed -
Add new module for working trees with the `git_worktree_list` function. The function lists names for all working trees of a certain repository.
Patrick Steinhardt committed
-