Page MenuHomePhabricator

D14850.id35898.diff
No OneTemporary

D14850.id35898.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
Oct 16 2024, 6:26 PM (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6718567
Default Alt Text
D14850.id35898.diff (1 KB)

Event Timeline