summaryrefslogtreecommitdiff
path: root/tests/checkout/index.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-06-29 09:58:34 +0200
committerPatrick Steinhardt <ps@pks.im>2019-07-20 19:11:20 +0200
commitded77bb1f18c6cb7a0371b3f66c92387413a161d (patch)
tree44b95bb7a1998304a57b86f9892e92e2da0a2cb6 /tests/checkout/index.c
parente54343a4024e75dfaa940e652c2c9799d33634b2 (diff)
downloadlibgit2-ded77bb1f18c6cb7a0371b3f66c92387413a161d.tar.gz
path: extract function to check whether a path supports symlinks
When initializing a repository, we need to check whether its working directory supports symlinks to correctly set the initial value of the "core.symlinks" config variable. The code to check the filesystem is reusable in other parts of our codebase, like for example in our tests to determine whether certain tests can be expected to succeed or not. Extract the code into a new function `git_path_supports_symlinks` to avoid duplicate implementations. Remove a duplicate implementation in the repo test helper code.
Diffstat (limited to 'tests/checkout/index.c')
-rw-r--r--tests/checkout/index.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/checkout/index.c b/tests/checkout/index.c
index dcacdd5d3..a76c471e8 100644
--- a/tests/checkout/index.c
+++ b/tests/checkout/index.c
@@ -181,7 +181,7 @@ void test_checkout_index__honor_coresymlinks_default_true(void)
cl_must_pass(p_mkdir("symlink", 0777));
- if (!filesystem_supports_symlinks("symlink/test"))
+ if (!git_path_supports_symlinks("symlink/test"))
cl_skip();
#ifdef GIT_WIN32
@@ -214,7 +214,7 @@ void test_checkout_index__honor_coresymlinks_default_false(void)
* supports symlinks. Bail entirely on POSIX platforms that
* do support symlinks.
*/
- if (filesystem_supports_symlinks("symlink/test"))
+ if (git_path_supports_symlinks("symlink/test"))
cl_skip();
#endif
@@ -226,7 +226,7 @@ void test_checkout_index__coresymlinks_set_to_true_fails_when_unsupported(void)
{
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
- if (filesystem_supports_symlinks("testrepo/test")) {
+ if (git_path_supports_symlinks("testrepo/test")) {
cl_skip();
}
@@ -242,7 +242,7 @@ void test_checkout_index__honor_coresymlinks_setting_set_to_true(void)
char link_data[GIT_PATH_MAX];
size_t link_size = GIT_PATH_MAX;
- if (!filesystem_supports_symlinks("testrepo/test")) {
+ if (!git_path_supports_symlinks("testrepo/test")) {
cl_skip();
}