aboutsummaryrefslogtreecommitdiff
path: root/builtin/revert.c
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2012-04-14 21:04:48 +0200
committerJunio C Hamano <gitster@pobox.com>2012-04-15 13:33:31 -0700
commit6d5b93f29f5362b9b84954d87684705227984f9e (patch)
tree14a0838e5657c9e29630b057d99ec4f460553743 /builtin/revert.c
parente8dde3e5f9ddb7cf95a6ff3cea6cf07c3a2db80d (diff)
downloadgit-6d5b93f29f5362b9b84954d87684705227984f9e.tar.gz
git-6d5b93f29f5362b9b84954d87684705227984f9e.tar.xz
cherry-pick: do not expect file arguments
If a commit-ish passed to cherry-pick or revert happens to have a file of the same name, git complains that the argument is ambiguous and advises to use '--'. To make things worse, the '--' argument is removed by parse_options, und so passing '--' has no effect. Instead, always interpret cherry-pick/revert arguments as revisions. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/revert.c')
-rw-r--r--builtin/revert.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index e6840f23d..92f3fa5f5 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -181,12 +181,15 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)
if (opts->subcommand != REPLAY_NONE) {
opts->revs = NULL;
} else {
+ struct setup_revision_opt s_r_opt;
opts->revs = xmalloc(sizeof(*opts->revs));
init_revisions(opts->revs, NULL);
opts->revs->no_walk = 1;
if (argc < 2)
usage_with_options(usage_str, options);
- argc = setup_revisions(argc, argv, opts->revs, NULL);
+ memset(&s_r_opt, 0, sizeof(s_r_opt));
+ s_r_opt.assume_dashdash = 1;
+ argc = setup_revisions(argc, argv, opts->revs, &s_r_opt);
}
if (argc > 1)