Commit 8533c80dfb4c09c4b19aa40756ffae99595c9b6b

Edward Thomson 2018-07-03T02:51:40

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.

diff --git a/tests/repo/init.c b/tests/repo/init.c
index 2ac09e4..52cf157 100644
--- a/tests/repo/init.c
+++ b/tests/repo/init.c
@@ -247,6 +247,19 @@ void test_repo_init__detect_ignorecase(void)
 		"core.ignorecase", found_without_match ? true : GIT_ENOTFOUND);
 }
 
+void test_repo_init__detect_symlinks(void)
+{
+	struct stat st;
+	bool no_symlinks;
+
+	no_symlinks = (p_symlink("target", "link") < 0 ||
+	    p_lstat("link", &st) < 0 ||
+	    ! (S_ISLNK(st.st_mode)));
+
+	assert_config_entry_on_init(
+	    "core.symlinks", no_symlinks ? false : GIT_ENOTFOUND);
+}
+
 void test_repo_init__detect_precompose_unicode_required(void)
 {
 #ifdef GIT_USE_ICONV