Skip to content

Commit 8533c80

Browse files
committed
repo tests: ensure core.symlinks is set correctly
Ensure that `core.symlinks` is set correctly. By default, it is unset, but it is explicitly set to `false` if the platform was detected to not support symlinks during repository initialization.
1 parent 204cce6 commit 8533c80

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/repo/init.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,19 @@ void test_repo_init__detect_ignorecase(void)
247247
"core.ignorecase", found_without_match ? true : GIT_ENOTFOUND);
248248
}
249249

250+
void test_repo_init__detect_symlinks(void)
251+
{
252+
struct stat st;
253+
bool no_symlinks;
254+
255+
no_symlinks = (p_symlink("target", "link") < 0 ||
256+
p_lstat("link", &st) < 0 ||
257+
! (S_ISLNK(st.st_mode)));
258+
259+
assert_config_entry_on_init(
260+
"core.symlinks", no_symlinks ? false : GIT_ENOTFOUND);
261+
}
262+
250263
void test_repo_init__detect_precompose_unicode_required(void)
251264
{
252265
#ifdef GIT_USE_ICONV

0 commit comments

Comments
 (0)