diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-06-28 15:53:16 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-06-28 15:53:17 -0700 |
| commit | ce75d32b99e7edd4ca7a99f376940b56d6c7ae0f (patch) | |
| tree | 74bebfe2611eb06a5b28852b70ab28bc39b103bf /t | |
| parent | 7b7db54b8319aa4f31348debb4bd9b838753aa8c (diff) | |
| parent | 313eec177ad010048b399d6fd14de871b517f7e3 (diff) | |
| download | git-ce75d32b99e7edd4ca7a99f376940b56d6c7ae0f.tar.gz | |
Merge branch 'jc/safe-directory-leading-path' into maint-2.45
The safe.directory configuration knob has been updated to
optionally allow leading path matches.
* jc/safe-directory-leading-path:
safe.directory: allow "lead/ing/path/*" match
Diffstat (limited to 't')
| -rwxr-xr-x | t/t0033-safe-directory.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t0033-safe-directory.sh b/t/t0033-safe-directory.sh index 11c3e8f28e..5fe61f1291 100755 --- a/t/t0033-safe-directory.sh +++ b/t/t0033-safe-directory.sh @@ -71,7 +71,22 @@ test_expect_success 'safe.directory=*, but is reset' ' expect_rejected_dir ' +test_expect_success 'safe.directory with matching glob' ' + git config --global --unset-all safe.directory && + p=$(pwd) && + git config --global safe.directory "${p%/*}/*" && + git status +' + +test_expect_success 'safe.directory with unmatching glob' ' + git config --global --unset-all safe.directory && + p=$(pwd) && + git config --global safe.directory "${p%/*}no/*" && + expect_rejected_dir +' + test_expect_success 'safe.directory in included file' ' + git config --global --unset-all safe.directory && cat >gitconfig-include <<-EOF && [safe] directory = "$(pwd)" |
