Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-10 01:25:44 +0300
committerJunio C Hamano <gitster@pobox.com>2019-07-10 01:25:44 +0300
commitf496b064fc1135e0dded7f93d85d72eb0b302c22 (patch)
tree2149d0faf99c67ddd76a6d68125037f661db48a5 /sequencer.c
parentb49d337bfbdd431697161244ff7b2241d9887c9f (diff)
parent97ed685701a6df0273f7d29fd5bc0a0658a63cad (diff)
Merge branch 'nd/switch-and-restore'
Two new commands "git switch" and "git restore" are introduced to split "checking out a branch to work on advancing its history" and "checking out paths out of the index and/or a tree-ish to work on advancing the current history" out of the single "git checkout" command. * nd/switch-and-restore: (46 commits) completion: disable dwim on "git switch -d" switch: allow to switch in the middle of bisect t2027: use test_must_be_empty Declare both git-switch and git-restore experimental help: move git-diff and git-reset to different groups doc: promote "git restore" user-manual.txt: prefer 'merge --abort' over 'reset --hard' completion: support restore t: add tests for restore restore: support --patch restore: replace --force with --ignore-unmerged restore: default to --source=HEAD when only --staged is specified restore: reject invalid combinations with --staged restore: add --worktree and --staged checkout: factor out worktree checkout code restore: disable overlay mode by default restore: make pathspec mandatory restore: take tree-ish from --source option instead checkout: split part of it to new command 'restore' doc: promote "git switch" ...
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c
index 4a9b7f1c3f..74a7a47d01 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2314,19 +2314,21 @@ static int have_finished_the_last_pick(void)
return ret;
}
-void sequencer_post_commit_cleanup(struct repository *r)
+void sequencer_post_commit_cleanup(struct repository *r, int verbose)
{
struct replay_opts opts = REPLAY_OPTS_INIT;
int need_cleanup = 0;
if (file_exists(git_path_cherry_pick_head(r))) {
- unlink(git_path_cherry_pick_head(r));
+ if (!unlink(git_path_cherry_pick_head(r)) && verbose)
+ warning(_("cancelling a cherry picking in progress"));
opts.action = REPLAY_PICK;
need_cleanup = 1;
}
if (file_exists(git_path_revert_head(r))) {
- unlink(git_path_revert_head(r));
+ if (!unlink(git_path_revert_head(r)) && verbose)
+ warning(_("cancelling a revert in progress"));
opts.action = REPLAY_REVERT;
need_cleanup = 1;
}