From 9d997df9643ba53595cac6f7c5af48d0400fd503 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 30 Sep 2015 07:45:02 -0700 Subject: [PATCH] Reset Drydock git working copies better Summary: Ref T9252. We're currently resetting to the local branch, but should be resetting to the origin branch. Test Plan: Restarted a build, had it run `git show`, saw proper HEAD. Reviewers: chad Reviewed By: chad Subscribers: hach-que Maniphest Tasks: T9252 Differential Revision: https://secure.phabricator.com/D14194 --- .../blueprint/DrydockWorkingCopyBlueprintImplementation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php index 2527a34cdc..843f043baa 100644 --- a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php @@ -213,7 +213,10 @@ final class DrydockWorkingCopyBlueprintImplementation $cmd[] = 'git reset --hard %s'; $arg[] = $commit; } else if ($branch !== null) { - $cmd[] = 'git reset --hard %s'; + $cmd[] = 'git checkout %s'; + $arg[] = $branch; + + $cmd[] = 'git reset --hard origin/%s'; $arg[] = $branch; } else { $cmd[] = 'git reset --hard HEAD';