summaryrefslogtreecommitdiff
path: root/include/git2/worktree.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix struct documentation formattingpunkymaniac2021-07-061-0/+1
|
* Rename opt init functions to `options_init`Edward Thomson2019-06-141-5/+5
| | | | | | | | | | | | | In libgit2 nomenclature, when we need to verb a direct object, we name a function `git_directobject_verb`. Thus, if we need to init an options structure named `git_foo_options`, then the name of the function that does that should be `git_foo_options_init`. The previous names of `git_foo_init_options` is close - it _sounds_ as if it's initializing the options of a `foo`, but in fact `git_foo_options` is its own noun that should be respected. Deprecate the old names; they'll now call directly to the new ones.
* worktree: Expose git_worktree_add_init_optionsOzan Sener2018-11-181-1/+1
|
* docs: standardize struct git_*_options commentsEtienne Samson2018-05-071-6/+4
|
* docs: standardize comment block for git_*_init_options functionsEtienne Samson2018-05-071-10/+28
|
* Merge pull request #4640 from mkeeler/worktree-convenience2Patrick Steinhardt2018-04-301-0/+18
|\ | | | | worktree: add functions to get name and path
| * worktree: add functions to get name and pathMatt Keeler2018-04-251-0/+18
| |
* | Merge pull request #4524 from pks-t/pks/worktree-refsEdward Thomson2018-04-171-1/+2
|\ \ | |/ |/| worktree: add ability to create worktree with pre-existing branch
| * worktree: add ability to create worktree with pre-existing branchPatrick Steinhardt2018-02-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* | worktree: lock reason should be constJacques Germishuys2018-03-021-1/+1
|/
* worktree: upgrade lock to an intEdward Thomson2017-06-041-1/+1
|
* worktree: switch over worktree pruning to an opts structurePatrick Steinhardt2017-05-051-9/+32
| | | | | | | | | | 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.
* worktree: support creating locked worktreesPatrick Steinhardt2017-05-051-1/+3
| | | | | | | | | | | | | 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.
* worktree: introduce git_worktree_add optionsPatrick Steinhardt2017-05-021-1/+23
| | | | | | | | | 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.
* worktree: implement `git_worktree_open_from_repository`Patrick Steinhardt2017-03-171-0/+12
| | | | | | | | | 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.
* worktree: extract git_worktree_is_prunablePatrick Steinhardt2017-02-131-0/+18
|
* worktree: implement functions reading HEADPatrick Steinhardt2017-02-131-1/+1
| | | | | | Implement `git_repository_head_for_worktree` and `git_repository_head_detached_for_worktree` for directly accessing a worktree's HEAD without opening it as a `git_repository` first.
* worktree: implement `git_worktree_prune`Patrick Steinhardt2017-02-131-0/+26
| | | | | | | 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.
* worktree: implement locking mechanismsPatrick Steinhardt2017-02-131-0/+36
| | | | | | 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.
* worktree: implement `git_worktree_add`Patrick Steinhardt2017-02-131-0/+15
| | | | | Implement the `git_worktree_add` function which can be used to create new working trees for a given repository.
* worktree: implement `git_worktree_validate`Patrick Steinhardt2017-02-131-0/+12
| | | | | | 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.
* worktree: introduce `struct git_worktree`Patrick Steinhardt2017-02-131-0/+17
| | | | | | | 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.
* worktree: implement `git_worktree_list`Patrick Steinhardt2017-02-131-0/+37
Add new module for working trees with the `git_worktree_list` function. The function lists names for all working trees of a certain repository.