summaryrefslogtreecommitdiff
path: root/tests/worktree/refs.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: verify renaming branch really updates worktree HEADPatrick Steinhardt2020-07-121-1/+4
| | | | | | | | | | | In case where a branch is getting renamed, all HEADs of the main repository and of its worktrees that point to the old branch need to get updated to point to the new branch. We already do so and have a test for this, but the test only verifies that we're able to lookup the updated HEAD, not what it contains. Let's make the test more specific by verifying the updated HEAD also has the correct updated symbolic target.
* strarray: we should `dispose` instead of `free`Edward Thomson2020-06-011-2/+2
| | | | | | We _dispose_ the contents of objects; we _free_ objects (and their contents). Update `git_strarray_free` to be `git_strarray_dispose`. `git_strarray_free` remains as a deprecated proxy function.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-1/+1
|
* Fix deletion of unrelated branch on worktreeSven Strickroth2018-04-201-0/+22
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* worktree: switch over worktree pruning to an opts structurePatrick Steinhardt2017-05-051-1/+4
| | | | | | | | | | 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.
* refs: update worktree HEADs when renaming branchesPatrick Steinhardt2017-04-051-0/+14
| | | | | | | Whenever we rename a branch, we update the repository's symbolic HEAD reference if it currently points to the branch that is to be renamed. But with the introduction of worktrees, we also have to iterate over all HEADs of linked worktrees to adjust them. Do so.
* tests: worktree::refs: convert spaces to tabsPatrick Steinhardt2017-04-051-14/+14
|
* refdb: create references in commondirPatrick Steinhardt2017-03-171-0/+26
| | | | | | | | | | | 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.
* repository: restrict checking out checked out branchesPatrick Steinhardt2017-02-131-0/+35
| | | | | | If a branch is already checked out in a working tree we are not allowed to check out that branch in another repository. Introduce this restriction when setting a repository's HEAD.
* branch: restrict branch deletion for worktreesPatrick Steinhardt2017-02-131-0/+27
| | | | | Restrict the ability to delete branches that are checked out in any linked repository.
* refdb: introduce commondir awarenessPatrick Steinhardt2017-02-131-0/+68
The refdb_fs_backend is not aware of the git commondir, which stores common objects like the o bject database and packed/loose refereensces when worktrees are used. Make refdb_fs_backend aware of the common directory by introducing a new commonpath variable that points to the actual common path of the database and using it instead of the gitdir for the mentioned objects.