Skip to content

Commit c00d1bf

Browse files
committed
test: verify annex availability via a secondary work tree
Refs: datalad/datalad-remake#21
1 parent 7d2c3ce commit c00d1bf

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

datalad_core/repo/tests/test_worktree.py

+23
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,26 @@ def test_worktree_init_at(tmp_path):
159159
# we got a new instance for the repo
160160
assert sep_wt.repo is not sep_repo_old
161161
assert sep_wt.repo.path == sep_repo_path_new
162+
163+
164+
def test_secondary_worktree_w_annex(tmp_path, annexrepo):
165+
wt1 = Worktree(annexrepo)
166+
test_file = wt1.path / 'myfile.dat'
167+
test_file.write_text('mycontent')
168+
call_git(['-C', str(wt1.path), 'annex', 'add', str(test_file)])
169+
call_git(['-C', str(wt1.path), 'commit', '-m', 'annexed file'])
170+
171+
branch = 'dummy'
172+
wt2_path = tmp_path / branch
173+
call_git(
174+
[
175+
'-C',
176+
str(annexrepo),
177+
'worktree',
178+
'add',
179+
str(wt2_path),
180+
]
181+
)
182+
wt2 = Worktree(wt2_path)
183+
assert wt2.annex is not None
184+
assert wt1.annex.uuid == wt2.annex.uuid

0 commit comments

Comments
 (0)