@matheusbsbs / matheus-bagliano / commits / 5486ef0e6d
Fork 0

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>

Junio C Hamano committed Nov 20, 2009 at 02:33 UTC 5486ef0e6d159a8971742fd2464b9656f5457fda
1 file changed +6 -3
revision.c
+6 -3
@@ -1230,6 +1230,7 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
1230 int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def)
1231 {
1232 int i, flags, left, seen_dashdash, read_from_stdin;
1233 + const char **prune_data = NULL;
1234
1235 /* First, search for "--" */
1236 seen_dashdash = 0;
@@ -1240,7 +1241,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
1241 argv[i] = NULL;
1242 argc = i;
1243 if (argv[i + 1])
1243 - revs->prune_data = get_pathspec(revs->prefix, argv + i + 1);
1244 + prune_data = argv + i + 1;
1245 seen_dashdash = 1;
1246 break;
1247 }
@@ -1321,12 +1322,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
1322 for (j = i; j < argc; j++)
1323 verify_filename(revs->prefix, argv[j]);
1324
1324 - revs->prune_data = get_pathspec(revs->prefix,
1325 - argv + i);
1325 + prune_data = argv + i;
1326 break;
1327 }
1328 }
1329
1330 + if (prune_data)
1331 + revs->prune_data = get_pathspec(revs->prefix, prune_data);
1332 +
1333 if (revs->def == NULL)
1334 revs->def = def;
1335 if (revs->show_merge)