summaryrefslogtreecommitdiff
path: root/tests/core
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-04-05 18:30:07 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-11-27 11:09:20 +0000
commit2cfa31c4179ea6722bbf85043428068aa8a0e58f (patch)
treeae7022a8156505759833ba21261c860203a9a443 /tests/core
parent1a724625e76d9127cf03fb780a924650345f7f60 (diff)
downloadlibgit2-2cfa31c4179ea6722bbf85043428068aa8a0e58f.tar.gz
path: remove unused git_path_topdir
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/path.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/tests/core/path.c b/tests/core/path.c
index 2e5a4ab24..eac3573fe 100644
--- a/tests/core/path.c
+++ b/tests/core/path.c
@@ -32,15 +32,6 @@ check_basename(const char *A, const char *B)
}
static void
-check_topdir(const char *A, const char *B)
-{
- const char *dir;
-
- cl_assert((dir = git_path_topdir(A)) != NULL);
- cl_assert_equal_s(B, dir);
-}
-
-static void
check_joinpath(const char *path_a, const char *path_b, const char *expected_path)
{
git_buf joined_path = GIT_BUF_INIT;
@@ -119,23 +110,6 @@ void test_core_path__01_basename(void)
check_basename(REP1024("/abc"), "abc");
}
-/* get the latest component in a path */
-void test_core_path__02_topdir(void)
-{
- check_topdir(".git/", ".git/");
- check_topdir("/.git/", ".git/");
- check_topdir("usr/local/.git/", ".git/");
- check_topdir("./.git/", ".git/");
- check_topdir("/usr/.git/", ".git/");
- check_topdir("/", "/");
- check_topdir("a/", "a/");
-
- cl_assert(git_path_topdir("/usr/.git") == NULL);
- cl_assert(git_path_topdir(".") == NULL);
- cl_assert(git_path_topdir("") == NULL);
- cl_assert(git_path_topdir("a") == NULL);
-}
-
/* properly join path components */
void test_core_path__05_joins(void)
{
@@ -285,7 +259,7 @@ void test_core_path__08_self_join(void)
cl_git_pass(git_buf_joinpath(&path, path.ptr + 4, "somethinglongenoughtorealloc"));
cl_assert_equal_s(path.ptr, "/baz/somethinglongenoughtorealloc");
cl_assert(asize < path.asize);
-
+
git_buf_dispose(&path);
}