setup_revisions(): do not call get_pathspec() too early
This is necessary because we will later allow pathspecs to be fed from the standard input, and pathspecs taken from the command line (and converted via get_pathspec() already) in revs->prune_data too early gets in the way when we want to append from the standard input. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
8b3dce5650
commit
5486ef0e6d
@ -1230,6 +1230,7 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
|
|||||||
int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def)
|
int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def)
|
||||||
{
|
{
|
||||||
int i, flags, left, seen_dashdash, read_from_stdin;
|
int i, flags, left, seen_dashdash, read_from_stdin;
|
||||||
|
const char **prune_data = NULL;
|
||||||
|
|
||||||
/* First, search for "--" */
|
/* First, search for "--" */
|
||||||
seen_dashdash = 0;
|
seen_dashdash = 0;
|
||||||
@ -1240,7 +1241,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
|
|||||||
argv[i] = NULL;
|
argv[i] = NULL;
|
||||||
argc = i;
|
argc = i;
|
||||||
if (argv[i + 1])
|
if (argv[i + 1])
|
||||||
revs->prune_data = get_pathspec(revs->prefix, argv + i + 1);
|
prune_data = argv + i + 1;
|
||||||
seen_dashdash = 1;
|
seen_dashdash = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1321,12 +1322,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
|
|||||||
for (j = i; j < argc; j++)
|
for (j = i; j < argc; j++)
|
||||||
verify_filename(revs->prefix, argv[j]);
|
verify_filename(revs->prefix, argv[j]);
|
||||||
|
|
||||||
revs->prune_data = get_pathspec(revs->prefix,
|
prune_data = argv + i;
|
||||||
argv + i);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (prune_data)
|
||||||
|
revs->prune_data = get_pathspec(revs->prefix, prune_data);
|
||||||
|
|
||||||
if (revs->def == NULL)
|
if (revs->def == NULL)
|
||||||
revs->def = def;
|
revs->def = def;
|
||||||
if (revs->show_merge)
|
if (revs->show_merge)
|
||||||
|
Loading…
Reference in New Issue
Block a user