From 9b585e00d8bd848dfdc5fb73475ffa1d5c5f4d9a Mon Sep 17 00:00:00 2001 From: cornelius Date: Fri, 18 Nov 2016 22:32:52 +0100 Subject: [PATCH] Fix "git-review -d" erases work directory if on the same branch as the change downloaded Story: 1096057 Task: 562 Change-Id: I3fed1bc02bc29da5295e436edeaedc42c3293589 --- git_review/cmd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/git_review/cmd.py b/git_review/cmd.py index 19adfae2..7cb60f6d 100644 --- a/git_review/cmd.py +++ b/git_review/cmd.py @@ -1129,8 +1129,8 @@ class CheckoutExistingBranchFailed(CommandFailed): EXIT_CODE = 65 -class ResetHardFailed(CommandFailed): - "Failed to hard reset downloaded branch" +class ResetKeepFailed(CommandFailed): + "Failed to reset downloaded branch" EXIT_CODE = 66 @@ -1245,8 +1245,8 @@ def checkout_review(branch_name, remote, remote_branch): raise BranchTrackingMismatch run_command_exc(CheckoutExistingBranchFailed, "git", "checkout", branch_name) - run_command_exc(ResetHardFailed, - "git", "reset", "--hard", "FETCH_HEAD") + run_command_exc(ResetKeepFailed, + "git", "reset", "--keep", "FETCH_HEAD") else: raise