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>2018-07-25 00:50:48 +0300
committerJunio C Hamano <gitster@pobox.com>2018-07-25 00:50:48 +0300
commitd94cecfe7525606070163437f7c59a51650f9e56 (patch)
treec956ab875c2fd1109fd59c3a28c7033d789211ab /sequencer.c
parent9cb10ca9df2f95e97b5a75d7fea3087972c298ae (diff)
parentc5e358d07355080ea0f7a56f1edcc2f28879d9f4 (diff)
Merge branch 'jk/empty-pick-fix'
Handling of an empty range by "git cherry-pick" was inconsistent depending on how the range ended up to be empty, which has been corrected. * jk/empty-pick-fix: sequencer: don't say BUG on bogus input sequencer: handle empty-set cases consistently
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sequencer.c b/sequencer.c
index 349ae04ffd..b89d5f2e34 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1864,8 +1864,6 @@ static int prepare_revs(struct replay_opts *opts)
if (prepare_revision_walk(opts->revs))
return error(_("revision walk setup failed"));
- if (!opts->revs->commits)
- return error(_("empty commit set passed"));
return 0;
}
@@ -2323,6 +2321,10 @@ static int walk_revs_populate_todo(struct todo_list *todo_list,
short_commit_name(commit), subject_len, subject);
unuse_commit_buffer(commit, commit_buffer);
}
+
+ if (!todo_list->nr)
+ return error(_("empty commit set passed"));
+
return 0;
}
@@ -3658,8 +3660,10 @@ int sequencer_pick_revisions(struct replay_opts *opts)
if (prepare_revision_walk(opts->revs))
return error(_("revision walk setup failed"));
cmit = get_revision(opts->revs);
- if (!cmit || get_revision(opts->revs))
- return error("BUG: expected exactly one commit from walk");
+ if (!cmit)
+ return error(_("empty commit set passed"));
+ if (get_revision(opts->revs))
+ BUG("unexpected extra commit from walk");
return single_pick(cmit, opts);
}