diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2018-05-22 16:13:47 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2018-05-23 08:47:08 +0200 |
| commit | a7168b47ee494c52ffe850784be9ad996f80441a (patch) | |
| tree | 290ea63c787104e9bdc36eaf0d0ef0316f6e2abc /tests/path/dotgit.c | |
| parent | 58ff913a13b840f1f6ee35e71e9d1de3470904ad (diff) | |
| download | libgit2-a7168b47ee494c52ffe850784be9ad996f80441a.tar.gz | |
path: reject .gitmodules as a symlink
Any part of the library which asks the question can pass in the mode to have it
checked against `.gitmodules` being a symlink.
This is particularly relevant for adding entries to the index from the worktree
and for checking out files.
Diffstat (limited to 'tests/path/dotgit.c')
| -rw-r--r-- | tests/path/dotgit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/path/dotgit.c b/tests/path/dotgit.c index 038e849c2..cad1e2586 100644 --- a/tests/path/dotgit.c +++ b/tests/path/dotgit.c @@ -106,3 +106,10 @@ void test_path_dotgit__dotgit_modules(void) } } + +void test_path_dotgit__dotgit_modules_symlink(void) +{ + cl_assert_equal_b(true, git_path_isvalid(NULL, ".gitmodules", 0, GIT_PATH_REJECT_DOT_GIT_HFS|GIT_PATH_REJECT_DOT_GIT_NTFS)); + cl_assert_equal_b(false, git_path_isvalid(NULL, ".gitmodules", S_IFLNK, GIT_PATH_REJECT_DOT_GIT_HFS)); + cl_assert_equal_b(false, git_path_isvalid(NULL, ".gitmodules", S_IFLNK, GIT_PATH_REJECT_DOT_GIT_NTFS)); +} |
