Page MenuHomePhabricator

D14850.id.diff
No OneTemporary

D14850.id.diff

diff --git a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
@@ -249,11 +249,15 @@
$ref = idx($spec, 'ref');
+ // Reset things first, in case previous builds left anything staged or
+ // dirty.
+ $cmd[] = 'git reset --hard HEAD';
+
if ($commit !== null) {
- $cmd[] = 'git reset --hard %s';
+ $cmd[] = 'git checkout %s --';
$arg[] = $commit;
} else if ($branch !== null) {
- $cmd[] = 'git checkout %s';
+ $cmd[] = 'git checkout %s --';
$arg[] = $branch;
$cmd[] = 'git reset --hard origin/%s';
@@ -267,13 +271,8 @@
$arg[] = $ref_ref;
$arg[] = $ref_ref;
- $cmd[] = 'git checkout %s';
- $arg[] = $ref_ref;
-
- $cmd[] = 'git reset --hard %s';
+ $cmd[] = 'git checkout %s --';
$arg[] = $ref_ref;
- } else {
- $cmd[] = 'git reset --hard HEAD';
}
$cmd = implode(' && ', $cmd);

File Metadata

Mime Type
text/plain
Expires
Sun, May 12, 3:36 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6274754
Default Alt Text
D14850.id.diff (1 KB)

Event Timeline