@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

epriestley and committed by
epriestley
bbf4ce79 5a35dd23

+15 -4
+15 -4
src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
··· 431 431 $src_ref, 432 432 $src_ref); 433 433 434 - $command = csprintf( 435 - 'git merge --no-stat --squash -- %R', 434 + // NOTE: This can never actually generate a commit because we pass 435 + // "--squash", but git sometimes runs code to check that a username and 436 + // email are configured anyway. 437 + $real_command = csprintf( 438 + 'git -c user.name=%s -c user.email=%s merge --no-stat --squash -- %R', 439 + 'drydock', 440 + 'drydock@phabricator', 441 + $src_ref); 442 + 443 + // Show the user a simplified command if the operation fails and we need to 444 + // report an error. 445 + $show_command = csprintf( 446 + 'git merge --squash -- %R', 436 447 $src_ref); 437 448 438 449 try { 439 - $interface->execx('%C', $command); 450 + $interface->execx('%C', $real_command); 440 451 } catch (CommandException $ex) { 441 452 $this->setWorkingCopyVCSErrorFromCommandException( 442 453 $lease, 443 454 self::PHASE_SQUASHMERGE, 444 - $command, 455 + $show_command, 445 456 $ex); 446 457 447 458 throw $ex;