mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Provide a username and email when running git merge --squash
Summary: Ref T182. This command should never actually generate a commit because `--squash` prevents that, but `git` seems to sometimes hit a check for username/email configuration (maybe when merging a non-fastforward?). Give it some dummy values to placate it. This command shouldn't commit anything so these values should never actually be used. Test Plan: Landed rGITTESTd8c8643cb02bbe60048c6c206afc2940c760a77e. Reviewers: chad, Mnkras Reviewed By: Mnkras Maniphest Tasks: T182 Differential Revision: https://secure.phabricator.com/D14347
This commit is contained in:
parent
5a35dd233b
commit
bbf4ce79e3
1 changed files with 15 additions and 4 deletions
|
@ -431,17 +431,28 @@ final class DrydockWorkingCopyBlueprintImplementation
|
|||
$src_ref,
|
||||
$src_ref);
|
||||
|
||||
$command = csprintf(
|
||||
'git merge --no-stat --squash -- %R',
|
||||
// NOTE: This can never actually generate a commit because we pass
|
||||
// "--squash", but git sometimes runs code to check that a username and
|
||||
// email are configured anyway.
|
||||
$real_command = csprintf(
|
||||
'git -c user.name=%s -c user.email=%s merge --no-stat --squash -- %R',
|
||||
'drydock',
|
||||
'drydock@phabricator',
|
||||
$src_ref);
|
||||
|
||||
// Show the user a simplified command if the operation fails and we need to
|
||||
// report an error.
|
||||
$show_command = csprintf(
|
||||
'git merge --squash -- %R',
|
||||
$src_ref);
|
||||
|
||||
try {
|
||||
$interface->execx('%C', $command);
|
||||
$interface->execx('%C', $real_command);
|
||||
} catch (CommandException $ex) {
|
||||
$this->setWorkingCopyVCSErrorFromCommandException(
|
||||
$lease,
|
||||
self::PHASE_SQUASHMERGE,
|
||||
$command,
|
||||
$show_command,
|
||||
$ex);
|
||||
|
||||
throw $ex;
|
||||
|
|
Loading…
Reference in a new issue