1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Fix incorrect quoting of author in 'arc patch'

Summary:
Author field is formatted with csprintf, which would be appropriate
if the resulting string was concatenated into a shell command as a
string -- but because the flags are passed as a vector of strings
and not parsed by the shell, this results in extraneous shell
quoting making it into to author field.   In particular this
renders my name as D'\''Anna instead of D'Anna

Test Plan:
Performed 'arc patch' with and without these changes, confirmed
that my apostrophe was no longer mangled by shell quotes in the
resulting commit.

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: MacFan4000, Ekubischta, speck, tobiaswiese, valerio.bozzolan

Differential Revision: https://we.phorge.it/D25026
This commit is contained in:
Lawrence D'\''Anna 2021-10-23 15:01:44 -04:00 committed by MacFan4000
parent 5407e5e5c6
commit 4230292997

View file

@ -743,7 +743,7 @@ EOTEXT
if ($this->shouldCommit()) { if ($this->shouldCommit()) {
$flags = array(); $flags = array();
if ($bundle->getFullAuthor()) { if ($bundle->getFullAuthor()) {
$flags[] = csprintf('--author=%s', $bundle->getFullAuthor()); $flags[] = sprintf('--author=%s', $bundle->getFullAuthor());
} }
$commit_message = $this->getCommitMessage($bundle); $commit_message = $this->getCommitMessage($bundle);