Revert "reset: Make reset remove the sequencer state"
This reverts commit 95eb88d8ee588d89b4f06d2753ed4d16ab13b39f, which was a UI experiment that did not reflect how "git reset" actually gets used. The reversion also fixes a test, indicated in the patch. Encouraged-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Dec 10, 2011 at 07:03 UTC
a7eff1e027270062c4c08f11d63b4103f3d917fe
3 files changed
+1
-55
branch.c
-2
@@ -3,7 +3,6 @@
3
#include "refs.h"
4
#include "remote.h"
5
#include "commit.h"
6
-#include "sequencer.h"
6
7
struct tracking {
8
struct refspec spec;
@@ -247,5 +246,4 @@ void remove_branch_state(void)
246
unlink(git_path("MERGE_MSG"));
247
unlink(git_path("MERGE_MODE"));
248
unlink(git_path("SQUASH_MSG"));
250
- remove_sequencer_state(0);
249
}
t/t3510-cherry-pick-sequence.sh
+1
-1
@@ -353,7 +353,7 @@ test_expect_success '--continue asks for help after resolving patch to nil' '
353
test_i18ngrep "The previous cherry-pick is now empty" msg
354
'
355
356
-test_expect_failure 'follow advice and skip nil patch' '
356
+test_expect_success 'follow advice and skip nil patch' '
357
pristine_detach conflicting &&
358
test_must_fail git cherry-pick initial..picked &&
359
t/t7106-reset-sequence.sh
deleted
-52
@@ -1,52 +0,0 @@
1
-#!/bin/sh
2
-
3
-test_description='Test interaction of reset --hard with sequencer
4
-
5
- + anotherpick: rewrites foo to d
6
- + picked: rewrites foo to c
7
- + unrelatedpick: rewrites unrelated to reallyunrelated
8
- + base: rewrites foo to b
9
- + initial: writes foo as a, unrelated as unrelated
10
-'
11
-
12
-. ./test-lib.sh
13
-
14
-pristine_detach () {
15
- git cherry-pick --quit &&
16
- git checkout -f "$1^0" &&
17
- git read-tree -u --reset HEAD &&
18
- git clean -d -f -f -q -x
19
-}
20
-
21
-test_expect_success setup '
22
- echo unrelated >unrelated &&
23
- git add unrelated &&
24
- test_commit initial foo a &&
25
- test_commit base foo b &&
26
- test_commit unrelatedpick unrelated reallyunrelated &&
27
- test_commit picked foo c &&
28
- test_commit anotherpick foo d &&
29
- git config advice.detachedhead false
30
-
31
-'
32
-
33
-test_expect_success 'reset --hard cleans up sequencer state, providing one-level undo' '
34
- pristine_detach initial &&
35
- test_must_fail git cherry-pick base..anotherpick &&
36
- test_path_is_dir .git/sequencer &&
37
- git reset --hard &&
38
- test_path_is_missing .git/sequencer &&
39
- test_path_is_dir .git/sequencer-old &&
40
- git reset --hard &&
41
- test_path_is_missing .git/sequencer-old
42
-'
43
-
44
-test_expect_success 'cherry-pick --abort does not leave sequencer-old dir' '
45
- pristine_detach initial &&
46
- test_must_fail git cherry-pick base..anotherpick &&
47
- git cherry-pick --abort &&
48
- test_path_is_missing .git/sequencer &&
49
- test_path_is_missing .git/sequencer-old
50
-'
51
-
52
-test_done