summaryrefslogtreecommitdiff
path: root/tests/core
diff options
context:
space:
mode:
authorEtienne Samson <samson.etienne@gmail.com>2018-09-18 12:12:06 +0000
committerEtienne Samson <samson.etienne@gmail.com>2018-09-25 14:44:40 +0200
commitbe4717d2a1f8ee152e46b2afc8d8510bc82243a5 (patch)
tree0f709a2fbd07f1de625f9476facb9eac74553da6 /tests/core
parent21496c3024b3ab4168a8e4b4d1ef03da736aeac5 (diff)
downloadlibgit2-be4717d2a1f8ee152e46b2afc8d8510bc82243a5.tar.gz
path: fix "comparison always true" warning
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/path.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/core/path.c b/tests/core/path.c
index 6910fabb7..058a710d0 100644
--- a/tests/core/path.c
+++ b/tests/core/path.c
@@ -676,3 +676,12 @@ void test_core_path__16_resolve_relative(void)
assert_common_dirlen(6, "a/b/c/foo.txt", "a/b/c/d/e/bar.txt");
assert_common_dirlen(7, "/a/b/c/foo.txt", "/a/b/c/d/e/bar.txt");
}
+
+void test_core_path__git_path_is_file(void)
+{
+ cl_git_fail(git_path_is_gitfile("blob", 4, -1, GIT_PATH_FS_HFS));
+ cl_git_pass(git_path_is_gitfile("blob", 4, GIT_PATH_GITFILE_GITIGNORE, GIT_PATH_FS_HFS));
+ cl_git_pass(git_path_is_gitfile("blob", 4, GIT_PATH_GITFILE_GITMODULES, GIT_PATH_FS_HFS));
+ cl_git_pass(git_path_is_gitfile("blob", 4, GIT_PATH_GITFILE_GITATTRIBUTES, GIT_PATH_FS_HFS));
+ cl_git_fail(git_path_is_gitfile("blob", 4, 3, GIT_PATH_FS_HFS));
+}