diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-27 13:58:02 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-27 13:58:02 -0700 |
commit | 0fe59d768643df4bcab419bb52509cf608dc074b (patch) | |
tree | 6a366154679e53f443042a0c1a791802ed52fdf5 /revision.c | |
parent | 157a4767a56e37def5e156b60f03ee220208d8fb (diff) | |
parent | 6d5b93f29f5362b9b84954d87684705227984f9e (diff) | |
download | git-0fe59d768643df4bcab419bb52509cf608dc074b.tar.gz |
Merge branch 'cb/cherry-pick-rev-path-confusion'
The command line parser choked "git cherry-pick $name" when $name can be
both revision name and a pathname, even though $name can never be a path
in the context of the command.
The issue the patch addresses is real, but the way it is implemented felt
unnecessarily invasive a bit. It may be cleaner for this caller to add
the "--" to the end of the argv_array it passes to setup_revisions().
By Clemens Buchacher
* cb/cherry-pick-rev-path-confusion:
cherry-pick: do not expect file arguments
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/revision.c b/revision.c index edb225d1fa..e0e80f13ef 100644 --- a/revision.c +++ b/revision.c @@ -1715,17 +1715,21 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s submodule = opt->submodule; /* First, search for "--" */ - seen_dashdash = 0; - for (i = 1; i < argc; i++) { - const char *arg = argv[i]; - if (strcmp(arg, "--")) - continue; - argv[i] = NULL; - argc = i; - if (argv[i + 1]) - append_prune_data(&prune_data, argv + i + 1); + if (opt && opt->assume_dashdash) { seen_dashdash = 1; - break; + } else { + seen_dashdash = 0; + for (i = 1; i < argc; i++) { + const char *arg = argv[i]; + if (strcmp(arg, "--")) + continue; + argv[i] = NULL; + argc = i; + if (argv[i + 1]) + append_prune_data(&prune_data, argv + i + 1); + seen_dashdash = 1; + break; + } } /* Second, deal with arguments and options */ |