Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
ethomson committed Oct 20, 2018
commit 8533c80dfb4c09c4b19aa40756ffae99595c9b6b
13 changes: 13 additions & 0 deletions tests/repo/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to have a common helper function to detect symlink support which unifies these three lines here and in "checkout::index".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed and done.


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
Expand Down