diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2018-05-22 14:16:45 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2018-05-22 14:16:45 +0200 |
| commit | a145f2b642e41dec3522dc449a2ef947ccd7a337 (patch) | |
| tree | cfebea500154eebb91be0776fc6107f0d0af17a2 /tests | |
| parent | 490cbaa97b6476d7103b82a26ef2c7c951c8ec5b (diff) | |
| download | libgit2-a145f2b642e41dec3522dc449a2ef947ccd7a337.tar.gz | |
checkout: add a failing test for refusing a symlinked .gitmodules
We want to reject these as they cause compatibility issues and can lead to git
writing to files outside of the repository.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/checkout/nasty.c | 7 | ||||
| -rw-r--r-- | tests/resources/nasty/.gitted/objects/07/f9d4d85b75187e4db5b9cbcad3e6218582bd57 | bin | 0 -> 93 bytes | |||
| -rw-r--r-- | tests/resources/nasty/.gitted/objects/2a/9eb82c733e31ae312cee349084dcbc6f69639a | bin | 0 -> 26 bytes | |||
| -rw-r--r-- | tests/resources/nasty/.gitted/objects/42/1376db9e8aee847e9d774891e73098a7415e94 | bin | 0 -> 21 bytes | |||
| -rw-r--r-- | tests/resources/nasty/.gitted/objects/e3/0b60b120761f44ebd0f0a7b0e9445ce8e11d68 | bin | 0 -> 146 bytes | |||
| -rw-r--r-- | tests/resources/nasty/.gitted/refs/heads/gitmodules-symlink | 1 |
6 files changed, 8 insertions, 0 deletions
diff --git a/tests/checkout/nasty.c b/tests/checkout/nasty.c index 952a6a112..736477923 100644 --- a/tests/checkout/nasty.c +++ b/tests/checkout/nasty.c @@ -364,3 +364,10 @@ void test_checkout_nasty__symlink3(void) test_checkout_passes("refs/heads/symlink3", ".git/foobar"); } +void test_checkout_nasty__gitmodules_symlink(void) +{ + cl_repo_set_bool(repo, "core.protectHFS", true); + cl_repo_set_bool(repo, "core.protectNTFS", true); + + test_checkout_passes("refs/heads/gitmodules-symlink", ".gitmodules"); +} diff --git a/tests/resources/nasty/.gitted/objects/07/f9d4d85b75187e4db5b9cbcad3e6218582bd57 b/tests/resources/nasty/.gitted/objects/07/f9d4d85b75187e4db5b9cbcad3e6218582bd57 Binary files differnew file mode 100644 index 000000000..f040922a4 --- /dev/null +++ b/tests/resources/nasty/.gitted/objects/07/f9d4d85b75187e4db5b9cbcad3e6218582bd57 diff --git a/tests/resources/nasty/.gitted/objects/2a/9eb82c733e31ae312cee349084dcbc6f69639a b/tests/resources/nasty/.gitted/objects/2a/9eb82c733e31ae312cee349084dcbc6f69639a Binary files differnew file mode 100644 index 000000000..c4717d5ce --- /dev/null +++ b/tests/resources/nasty/.gitted/objects/2a/9eb82c733e31ae312cee349084dcbc6f69639a diff --git a/tests/resources/nasty/.gitted/objects/42/1376db9e8aee847e9d774891e73098a7415e94 b/tests/resources/nasty/.gitted/objects/42/1376db9e8aee847e9d774891e73098a7415e94 Binary files differnew file mode 100644 index 000000000..0666ba796 --- /dev/null +++ b/tests/resources/nasty/.gitted/objects/42/1376db9e8aee847e9d774891e73098a7415e94 diff --git a/tests/resources/nasty/.gitted/objects/e3/0b60b120761f44ebd0f0a7b0e9445ce8e11d68 b/tests/resources/nasty/.gitted/objects/e3/0b60b120761f44ebd0f0a7b0e9445ce8e11d68 Binary files differnew file mode 100644 index 000000000..1c1be161d --- /dev/null +++ b/tests/resources/nasty/.gitted/objects/e3/0b60b120761f44ebd0f0a7b0e9445ce8e11d68 diff --git a/tests/resources/nasty/.gitted/refs/heads/gitmodules-symlink b/tests/resources/nasty/.gitted/refs/heads/gitmodules-symlink new file mode 100644 index 000000000..3a2499fab --- /dev/null +++ b/tests/resources/nasty/.gitted/refs/heads/gitmodules-symlink @@ -0,0 +1 @@ +e30b60b120761f44ebd0f0a7b0e9445ce8e11d68 |
