Skip to content

Commit 5486ef0

Browse files
committed
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>
1 parent 8b3dce5 commit 5486ef0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

revision.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,7 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
12301230
int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def)
12311231
{
12321232
int i, flags, left, seen_dashdash, read_from_stdin;
1233+
const char **prune_data = NULL;
12331234

12341235
/* First, search for "--" */
12351236
seen_dashdash = 0;
@@ -1240,7 +1241,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
12401241
argv[i] = NULL;
12411242
argc = i;
12421243
if (argv[i + 1])
1243-
revs->prune_data = get_pathspec(revs->prefix, argv + i + 1);
1244+
prune_data = argv + i + 1;
12441245
seen_dashdash = 1;
12451246
break;
12461247
}
@@ -1321,12 +1322,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
13211322
for (j = i; j < argc; j++)
13221323
verify_filename(revs->prefix, argv[j]);
13231324

1324-
revs->prune_data = get_pathspec(revs->prefix,
1325-
argv + i);
1325+
prune_data = argv + i;
13261326
break;
13271327
}
13281328
}
13291329

1330+
if (prune_data)
1331+
revs->prune_data = get_pathspec(revs->prefix, prune_data);
1332+
13301333
if (revs->def == NULL)
13311334
revs->def = def;
13321335
if (revs->show_merge)

0 commit comments

Comments
 (0)