diff options
| author | Edward Thomson <ethomson@github.com> | 2021-10-31 09:45:46 -0400 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-11-09 15:17:17 +0000 |
| commit | 95117d4744cf5a66f2bcde7991a925e9852d9b1e (patch) | |
| tree | 070b80735f355dbb91528da9b98432ea747ae2f3 /tests/worktree | |
| parent | 44ec8b5cdf960cfeb66284a3cd5bdd8c14aefedf (diff) | |
| download | libgit2-95117d4744cf5a66f2bcde7991a925e9852d9b1e.tar.gz | |
path: separate git-specific path functions from util
Introduce `git_fs_path`, which operates on generic filesystem paths.
`git_path` will be kept for only git-specific path functionality (for
example, checking for `.git` in a path).
Diffstat (limited to 'tests/worktree')
| -rw-r--r-- | tests/worktree/merge.c | 2 | ||||
| -rw-r--r-- | tests/worktree/refs.c | 4 | ||||
| -rw-r--r-- | tests/worktree/submodule.c | 2 | ||||
| -rw-r--r-- | tests/worktree/worktree.c | 14 |
4 files changed, 11 insertions, 11 deletions
diff --git a/tests/worktree/merge.c b/tests/worktree/merge.c index 8bb95d1f7..5b7e2a837 100644 --- a/tests/worktree/merge.c +++ b/tests/worktree/merge.c @@ -73,7 +73,7 @@ void test_worktree_merge__merge_setup(void) cl_git_pass(git_str_joinpath(&path, fixture.worktree->gitdir, merge_files[i])); - cl_assert(git_path_exists(path.ptr)); + cl_assert(git_fs_path_exists(path.ptr)); } git_str_dispose(&path); diff --git a/tests/worktree/refs.c b/tests/worktree/refs.c index 5ae17ca19..557726aaf 100644 --- a/tests/worktree/refs.c +++ b/tests/worktree/refs.c @@ -181,14 +181,14 @@ void test_worktree_refs__creating_refs_uses_commondir(void) cl_git_pass(git_str_joinpath(&refpath, git_repository_commondir(fixture.worktree), "refs/heads/testbranch")); - cl_assert(!git_path_exists(refpath.ptr)); + cl_assert(!git_fs_path_exists(refpath.ptr)); cl_git_pass(git_repository_head(&head, fixture.worktree)); cl_git_pass(git_commit_lookup(&commit, fixture.worktree, git_reference_target(head))); cl_git_pass(git_branch_create(&branch, fixture.worktree, "testbranch", commit, 0)); cl_git_pass(git_branch_lookup(&lookup, fixture.worktree, "testbranch", GIT_BRANCH_LOCAL)); cl_assert(git_reference_cmp(branch, lookup) == 0); - cl_assert(git_path_exists(refpath.ptr)); + cl_assert(git_fs_path_exists(refpath.ptr)); git_reference_free(lookup); git_reference_free(branch); diff --git a/tests/worktree/submodule.c b/tests/worktree/submodule.c index 4c6c657d3..6b0c07452 100644 --- a/tests/worktree/submodule.c +++ b/tests/worktree/submodule.c @@ -67,7 +67,7 @@ void test_worktree_submodule__resolve_relative_url(void) git_worktree *wt; cl_git_pass(git_futils_mkdir("subdir", 0755, GIT_MKDIR_PATH)); - cl_git_pass(git_path_prettify_dir(&wt_path, "subdir", NULL)); + cl_git_pass(git_fs_path_prettify_dir(&wt_path, "subdir", NULL)); cl_git_pass(git_str_joinpath(&wt_path, wt_path.ptr, "wt")); /* Open child repository, which is a submodule */ diff --git a/tests/worktree/worktree.c b/tests/worktree/worktree.c index a9a50fbf1..6f14b17f1 100644 --- a/tests/worktree/worktree.c +++ b/tests/worktree/worktree.c @@ -330,7 +330,7 @@ void test_worktree_worktree__init_existing_path(void) for (i = 0; i < ARRAY_SIZE(wtfiles); i++) { cl_git_pass(git_str_joinpath(&path, fixture.worktree->gitdir, wtfiles[i])); - cl_assert(!git_path_exists(path.ptr)); + cl_assert(!git_fs_path_exists(path.ptr)); } git_str_dispose(&path); @@ -351,9 +351,9 @@ void test_worktree_worktree__init_submodule(void) cl_git_pass(git_worktree_add(&worktree, sm, "repo-worktree", path.ptr, NULL)); cl_git_pass(git_repository_open_from_worktree(&wt, worktree)); - cl_git_pass(git_path_prettify_dir(&path, path.ptr, NULL)); + cl_git_pass(git_fs_path_prettify_dir(&path, path.ptr, NULL)); cl_assert_equal_s(path.ptr, wt->workdir); - cl_git_pass(git_path_prettify_dir(&path, sm->commondir, NULL)); + cl_git_pass(git_fs_path_prettify_dir(&path, sm->commondir, NULL)); cl_assert_equal_s(sm->commondir, wt->commondir); cl_git_pass(git_str_joinpath(&path, sm->gitdir, "worktrees/repo-worktree/")); @@ -560,8 +560,8 @@ void test_worktree_worktree__prune_gitdir_only(void) cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree")); cl_git_pass(git_worktree_prune(wt, &opts)); - cl_assert(!git_path_exists(wt->gitdir_path)); - cl_assert(git_path_exists(wt->gitlink_path)); + cl_assert(!git_fs_path_exists(wt->gitdir_path)); + cl_assert(git_fs_path_exists(wt->gitlink_path)); git_worktree_free(wt); } @@ -576,8 +576,8 @@ void test_worktree_worktree__prune_worktree(void) cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree")); cl_git_pass(git_worktree_prune(wt, &opts)); - cl_assert(!git_path_exists(wt->gitdir_path)); - cl_assert(!git_path_exists(wt->gitlink_path)); + cl_assert(!git_fs_path_exists(wt->gitdir_path)); + cl_assert(!git_fs_path_exists(wt->gitlink_path)); git_worktree_free(wt); } |
