diff options
-rwxr-xr-x | git-svn.perl | 1 | ||||
-rwxr-xr-x | t/t9138-git-svn-authors-prog.sh | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/git-svn.perl b/git-svn.perl index d075810724..24bdbf5b81 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2810,6 +2810,7 @@ sub other_gs { sub call_authors_prog { my ($orig_author) = @_; + $orig_author = command_oneline('rev-parse', '--sq-quote', $orig_author); my $author = `$::_authors_prog $orig_author`; if ($? != 0) { die "$::_authors_prog failed with exit code $?\n" diff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh index a4b00f2a3f..83cc5fc9d1 100755 --- a/t/t9138-git-svn-authors-prog.sh +++ b/t/t9138-git-svn-authors-prog.sh @@ -66,4 +66,18 @@ test_expect_success 'authors-file overrode authors-prog' ' ) ' +git --git-dir=x/.git config --unset svn.authorsfile +git --git-dir=x/.git config --unset svn.authorsprog + +test_expect_success 'authors-prog handled special characters in username' ' + svn mkdir -m bad --username "xyz; touch evil" "$svnrepo"/bad && + ( + cd x && + git svn --authors-prog=../svn-authors-prog fetch && + git rev-list -1 --pretty=raw refs/remotes/git-svn | + grep "^author xyz; touch evil <xyz; touch evil@example\.com> " && + ! test -f evil + ) +' + test_done |