summaryrefslogtreecommitdiff
path: root/tests/worktree/worktree.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-11-04 11:59:52 +0100
committerPatrick Steinhardt <ps@pks.im>2017-02-13 11:07:52 +0100
commit84f56cb05afe7a60501f310ba1329bb98ef8756d (patch)
tree69c54d4ce619b753d64ec09b4360cfcc4f21df1e /tests/worktree/worktree.c
parent384518d09dc16b8a7dae22069e0c612e4b65c5e8 (diff)
downloadlibgit2-84f56cb05afe7a60501f310ba1329bb98ef8756d.tar.gz
repository: rename `path_repository` and `path_gitlink`
The `path_repository` variable is actually confusing to think about, as it is not always clear what the repository actually is. It may either be the path to the folder containing worktree and .git directory, the path to .git itself, a worktree or something entirely different. Actually, the intent of the variable is to hold the path to the gitdir, which is either the .git directory or the bare repository. Rename the variable to `gitdir` to avoid confusion. While at it, also rename `path_gitlink` to `gitlink` to improve consistency.
Diffstat (limited to 'tests/worktree/worktree.c')
-rw-r--r--tests/worktree/worktree.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/worktree/worktree.c b/tests/worktree/worktree.c
index 756cf387b..81d592951 100644
--- a/tests/worktree/worktree.c
+++ b/tests/worktree/worktree.c
@@ -117,8 +117,8 @@ void test_worktree_worktree__lookup(void)
git_buf_printf(&gitdir_path, "%s/worktrees/%s", fixture.repo->commondir, "testrepo-worktree");
cl_assert_equal_s(wt->gitdir_path, gitdir_path.ptr);
- cl_assert_equal_s(wt->parent_path, fixture.repo->path_repository);
- cl_assert_equal_s(wt->gitlink_path, fixture.worktree->path_gitlink);
+ cl_assert_equal_s(wt->parent_path, fixture.repo->gitdir);
+ cl_assert_equal_s(wt->gitlink_path, fixture.worktree->gitlink);
cl_assert_equal_s(wt->commondir_path, fixture.repo->commondir);
git_buf_free(&gitdir_path);
@@ -196,7 +196,7 @@ void test_worktree_worktree__open_invalid_parent(void)
cl_git_pass(git_buf_sets(&buf, "/path/to/nonexistent/gitdir"));
cl_git_pass(git_futils_writebuffer(&buf,
- fixture.worktree->path_gitlink, O_RDWR, 0644));
+ fixture.worktree->gitlink, O_RDWR, 0644));
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
cl_git_fail(git_repository_open_from_worktree(&repo, wt));
@@ -254,7 +254,7 @@ void test_worktree_worktree__init_existing_worktree(void)
cl_git_fail(git_worktree_add(&wt, fixture.repo, "testrepo-worktree", path.ptr));
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
- cl_assert_equal_s(wt->gitlink_path, fixture.worktree->path_gitlink);
+ cl_assert_equal_s(wt->gitlink_path, fixture.worktree->gitlink);
git_buf_free(&path);
git_worktree_free(wt);
@@ -271,7 +271,7 @@ void test_worktree_worktree__init_existing_path(void)
* the init call */
for (i = 0; i < ARRAY_SIZE(wtfiles); i++) {
cl_git_pass(git_buf_joinpath(&path,
- fixture.worktree->path_repository, wtfiles[i]));
+ fixture.worktree->gitdir, wtfiles[i]));
cl_git_pass(p_unlink(path.ptr));
}
@@ -281,7 +281,7 @@ void test_worktree_worktree__init_existing_path(void)
/* Verify files have not been re-created */
for (i = 0; i < ARRAY_SIZE(wtfiles); i++) {
cl_git_pass(git_buf_joinpath(&path,
- fixture.worktree->path_repository, wtfiles[i]));
+ fixture.worktree->gitdir, wtfiles[i]));
cl_assert(!git_path_exists(path.ptr));
}