Commit Graph

4 Commits

Author SHA1 Message Date
Patrick Steinhardt
097f0105b4 refdb: create references in commondir
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.
2017-03-17 09:27:56 +01:00
Patrick Steinhardt
384518d09d repository: restrict checking out checked out branches
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.
2017-02-13 11:06:52 +01:00
Patrick Steinhardt
143e539fd0 branch: restrict branch deletion for worktrees
Restrict the ability to delete branches that are checked out in
any linked repository.
2017-02-13 11:05:57 +01:00
Patrick Steinhardt
e0a6c28eb3 refdb: introduce commondir awareness
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.
2017-02-13 10:28:15 +01:00