Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13983560
D14850.id35899.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14850.id35899.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 21, 7:17 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6718567
Default Alt Text
D14850.id35899.diff (1 KB)
Attached To
Mode
D14850: In Drydock, don't reset current branch to point at unrelated commit
Attached
Detach File
Event Timeline
Log In to Comment