diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2022-05-29 02:11:13 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-31 09:07:31 +0300 |
commit | de1f68a968e64b3e1e2979222238fec1f045bbf3 (patch) | |
tree | f73cd5decd04211e3b4f855e43c6cc9d0929d45d /t/t5003-archive-zip.sh | |
parent | 237a1d138c4322a7e934f129dee02e2ea6a214cd (diff) |
archive --add-virtual-file: allow paths containing colons
By allowing the path to be enclosed in double-quotes, we can avoid
the limitation that paths cannot contain colons.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5003-archive-zip.sh')
-rwxr-xr-x | t/t5003-archive-zip.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t5003-archive-zip.sh b/t/t5003-archive-zip.sh index d6027189e2..3992d08158 100755 --- a/t/t5003-archive-zip.sh +++ b/t/t5003-archive-zip.sh @@ -207,13 +207,21 @@ check_zip with_untracked check_added with_untracked untracked untracked test_expect_success UNZIP 'git archive --format=zip --add-virtual-file' ' + if test_have_prereq FUNNYNAMES + then + PATHNAME="pathname with : colon" + else + PATHNAME="pathname without colon" + fi && git archive --format=zip >with_file_with_content.zip \ + --add-virtual-file=\""$PATHNAME"\": \ --add-virtual-file=hello:world $EMPTY_TREE && test_when_finished "rm -rf tmp-unpack" && mkdir tmp-unpack && ( cd tmp-unpack && "$GIT_UNZIP" ../with_file_with_content.zip && test_path_is_file hello && + test_path_is_file "$PATHNAME" && test world = $(cat hello) ) ' |