diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:17 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-01-25 14:19:17 -0800 |
| commit | c7b1aaf6d6bb5746a98831854313ca8fccea600d (patch) | |
| tree | ba09f9c7df3f2eb5a690b9a39be37915aebf4b18 /t/t7416-submodule-dash-url.sh | |
| parent | Merge branch 'ab/branch-sort' (diff) | |
| parent | fsck: reject .gitmodules git:// urls with newlines (diff) | |
| download | git-c7b1aaf6d6bb5746a98831854313ca8fccea600d.tar.gz git-c7b1aaf6d6bb5746a98831854313ca8fccea600d.zip | |
Merge branch 'jk/forbid-lf-in-git-url'
Newline characters in the host and path part of git:// URL are
now forbidden.
* jk/forbid-lf-in-git-url:
fsck: reject .gitmodules git:// urls with newlines
git_connect_git(): forbid newlines in host and path
Diffstat (limited to 't/t7416-submodule-dash-url.sh')
| -rwxr-xr-x | t/t7416-submodule-dash-url.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7416-submodule-dash-url.sh b/t/t7416-submodule-dash-url.sh index eec96e0ba9..d21dc8b009 100755 --- a/t/t7416-submodule-dash-url.sh +++ b/t/t7416-submodule-dash-url.sh @@ -201,4 +201,19 @@ test_expect_success 'fsck rejects embedded newline in relative url' ' grep gitmodulesUrl err ' +test_expect_success 'fsck rejects embedded newline in git url' ' + git checkout --orphan git-newline && + cat >.gitmodules <<-\EOF && + [submodule "foo"] + url = "git://example.com:1234/repo%0a.git" + EOF + git add .gitmodules && + git commit -m "git url with newline" && + test_when_finished "rm -rf dst" && + git init --bare dst && + git -C dst config transfer.fsckObjects true && + test_must_fail git push dst HEAD 2>err && + grep gitmodulesUrl err +' + test_done |
