aboutsummaryrefslogtreecommitdiff
path: root/branch.c
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2011-08-04 16:09:12 +0530
committerJunio C Hamano <gitster@pobox.com>2011-08-08 09:24:50 -0700
commit95eb88d8ee588d89b4f06d2753ed4d16ab13b39f (patch)
treeee9bd4f977a3f4c1df67cb42e4d90dc709f90ac9 /branch.c
parent26ae337be11e440420d8ec7ce415425daaabe573 (diff)
downloadgit-95eb88d8ee588d89b4f06d2753ed4d16ab13b39f.tar.gz
git-95eb88d8ee588d89b4f06d2753ed4d16ab13b39f.tar.xz
reset: Make reset remove the sequencer state
Years of muscle memory have trained users to use "git reset --hard" to remove the branch state after any sort operation. Make it also remove the sequencer state to facilitate this established workflow: $ git cherry-pick foo..bar ... conflict encountered ... $ git reset --hard # Oops, I didn't mean that $ git cherry-pick quux..bar ... cherry-pick succeeded ... Guard against accidental removal of the sequencer state by providing one level of "undo". In the first "reset" invocation, ".git/sequencer" is moved to ".git/sequencer-old"; it is completely removed only in the second invocation. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/branch.c b/branch.c
index c0c865a4b..d06aec463 100644
--- a/branch.c
+++ b/branch.c
@@ -3,6 +3,7 @@
#include "refs.h"
#include "remote.h"
#include "commit.h"
+#include "sequencer.h"
struct tracking {
struct refspec spec;
@@ -228,4 +229,5 @@ void remove_branch_state(void)
unlink(git_path("MERGE_MSG"));
unlink(git_path("MERGE_MODE"));
unlink(git_path("SQUASH_MSG"));
+ remove_sequencer_state(0);
}