diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-08-24 15:32:38 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-08-24 15:32:38 -0700 |
| commit | aab0eeaba56e87f4d471b8e2aba9a648e5606d01 (patch) | |
| tree | bbc00ea37f54ff6005fa6b909a87e81fc85ed062 /t | |
| parent | f19b2752e7788ad3a66812fd37fc482fc247eb4c (diff) | |
| parent | 7ed37eb8ae485ff5590c656e871d6c739edfa067 (diff) | |
| download | git-aab0eeaba56e87f4d471b8e2aba9a648e5606d01.tar.gz | |
Merge branch 'js/expand-runtime-prefix'
Pathname expansion (like "~username/") learned a way to specify a
location relative to Git installation (e.g. its $sharedir which is
$(prefix)/share), with "%(prefix)".
* js/expand-runtime-prefix:
expand_user_path: allow in-flight topics to keep using the old name
interpolate_path(): allow specifying paths relative to the runtime prefix
Use a better name for the function interpolating paths
expand_user_path(): clarify the role of the `real_home` parameter
expand_user_path(): remove stale part of the comment
tests: exercise the RUNTIME_PREFIX feature
Diffstat (limited to 't')
| -rwxr-xr-x | t/t0060-path-utils.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index de4960783f..34d1061f32 100755 --- a/t/t0060-path-utils.sh +++ b/t/t0060-path-utils.sh @@ -525,4 +525,30 @@ test_expect_success MINGW 'is_valid_path() on Windows' ' "PRN./abc" ' +test_lazy_prereq RUNTIME_PREFIX ' + test true = "$RUNTIME_PREFIX" +' + +test_lazy_prereq CAN_EXEC_IN_PWD ' + cp "$GIT_EXEC_PATH"/git$X ./ && + ./git rev-parse +' + +test_expect_success RUNTIME_PREFIX,CAN_EXEC_IN_PWD 'RUNTIME_PREFIX works' ' + mkdir -p pretend/bin pretend/libexec/git-core && + echo "echo HERE" | write_script pretend/libexec/git-core/git-here && + cp "$GIT_EXEC_PATH"/git$X pretend/bin/ && + GIT_EXEC_PATH= ./pretend/bin/git here >actual && + echo HERE >expect && + test_cmp expect actual' + +test_expect_success RUNTIME_PREFIX,CAN_EXEC_IN_PWD '%(prefix)/ works' ' + mkdir -p pretend/bin && + cp "$GIT_EXEC_PATH"/git$X pretend/bin/ && + git config yes.path "%(prefix)/yes" && + GIT_EXEC_PATH= ./pretend/bin/git config --path yes.path >actual && + echo "$(pwd)/pretend/yes" >expect && + test_cmp expect actual +' + test_done |
