Apply suggestions from code review
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/src/worktree.c b/src/worktree.c
index ea5a403..5b1e279 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -262,7 +262,7 @@ int git_worktree_validate(const git_worktree *wt)
if (!git_path_exists(wt->worktree_path)) {
git_error_set(GIT_ERROR_WORKTREE,
- "worktree directory ('%s') does not exist ",
+ "worktree directory '%s' does not exist",
wt->worktree_path);
return GIT_ERROR;
}
diff --git a/tests/worktree/worktree.c b/tests/worktree/worktree.c
index 88bcaa9..f2078a3 100644
--- a/tests/worktree/worktree.c
+++ b/tests/worktree/worktree.c
@@ -618,6 +618,7 @@ void test_worktree_worktree__validate_invalid_worktreedir(void)
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
p_rename("testrepo-worktree", "testrepo-worktree-tmp");
cl_git_fail(git_worktree_validate(wt));
+ p_rename("testrepo-worktree-tmp", "testrepo-worktree");
git_worktree_free(wt);
}
diff --git a/tests/worktree/worktree_helpers.c b/tests/worktree/worktree_helpers.c
index 8d78e16..6d4cdba 100644
--- a/tests/worktree/worktree_helpers.c
+++ b/tests/worktree/worktree_helpers.c
@@ -19,7 +19,6 @@ void cleanup_fixture_worktree(worktree_fixture *fixture)
cl_fixture_cleanup(fixture->reponame);
if (fixture->worktreename)
cl_fixture_cleanup(fixture->worktreename);
- p_rename("testrepo-worktree-tmp", "testrepo-worktree");
}
void setup_fixture_worktree(worktree_fixture *fixture)