diff options
author | Ramkumar Ramachandra <artagnon@gmail.com> | 2011-08-04 16:09:11 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-04 15:41:21 -0700 |
commit | 26ae337be11e440420d8ec7ce415425daaabe573 (patch) | |
tree | f1a4a054c319020cab33f64a42f8faba210c92dc /t/t3510-cherry-pick-sequence.sh | |
parent | 21b14778a9b033d80b3e5757d9576da13ba446cd (diff) | |
download | git-26ae337be11e440420d8ec7ce415425daaabe573.tar.gz |
revert: Introduce --reset to remove sequencer state
To explicitly remove the sequencer state for a fresh cherry-pick or
revert invocation, introduce a new subcommand called "--reset" to
remove the sequencer state.
Take the opportunity to publicly expose the sequencer paths, and a
generic function called "remove_sequencer_state" that various git
programs can use to remove the sequencer state in a uniform manner;
"git reset" uses it later in this series. Introducing this public API
is also in line with our long-term goal of eventually factoring out
functions from revert.c into a generic commit sequencer.
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 't/t3510-cherry-pick-sequence.sh')
-rwxr-xr-x | t/t3510-cherry-pick-sequence.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh index 8ee000180a..fd6986541a 100755 --- a/t/t3510-cherry-pick-sequence.sh +++ b/t/t3510-cherry-pick-sequence.sh @@ -13,7 +13,7 @@ test_description='Test cherry-pick continuation features . ./test-lib.sh pristine_detach () { - rm -rf .git/sequencer && + git cherry-pick --reset && git checkout -f "$1^0" && git read-tree -u --reset HEAD && git clean -d -f -f -q -x @@ -70,4 +70,16 @@ test_expect_success 'cherry-pick cleans up sequencer state upon success' ' test_path_is_missing .git/sequencer ' +test_expect_success '--reset does not complain when no cherry-pick is in progress' ' + pristine_detach initial && + git cherry-pick --reset +' + +test_expect_success '--reset cleans up sequencer state' ' + pristine_detach initial && + test_must_fail git cherry-pick base..picked && + git cherry-pick --reset && + test_path_is_missing .git/sequencer +' + test_done |