Commit 303b4c68 by Reginald McLean

worktree: change test to invalidate worktree via filesystem

parent 6405ce29
...@@ -616,11 +616,8 @@ void test_worktree_worktree__validate_invalid_worktreedir(void) ...@@ -616,11 +616,8 @@ void test_worktree_worktree__validate_invalid_worktreedir(void)
git_worktree *wt; git_worktree *wt;
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree")); cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
git__free(wt->worktree_path); p_rename("testrepo-worktree", "testrepo-worktree-tmp");
wt->worktree_path = "/path/to/invalid/worktreedir";
cl_git_fail(git_worktree_validate(wt)); cl_git_fail(git_worktree_validate(wt));
wt->worktree_path = NULL;
git_worktree_free(wt); git_worktree_free(wt);
} }
...@@ -19,6 +19,7 @@ void cleanup_fixture_worktree(worktree_fixture *fixture) ...@@ -19,6 +19,7 @@ void cleanup_fixture_worktree(worktree_fixture *fixture)
cl_fixture_cleanup(fixture->reponame); cl_fixture_cleanup(fixture->reponame);
if (fixture->worktreename) if (fixture->worktreename)
cl_fixture_cleanup(fixture->worktreename); cl_fixture_cleanup(fixture->worktreename);
p_rename("testrepo-worktree-tmp", "testrepo-worktree");
} }
void setup_fixture_worktree(worktree_fixture *fixture) void setup_fixture_worktree(worktree_fixture *fixture)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment