report_path_error(): drop unused prefix parameter

This hasn't been used since 17ddc66e70 (convert report_path_error to take struct pathspec, 2013-07-14), as the names in the struct will have already been prefixed when they were parsed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Mar 20, 2019 at 04:15 UTC c5c33504c906f6bf09fe00a1a32c6c4bdb76ed0f
6 files changed +8 -9
builtin/checkout.c
+1 -1
@@ -376,7 +376,7 @@ static int checkout_paths(const struct checkout_opts *opts,
376 ps_matched,
377 opts);
378
379 - if (report_path_error(ps_matched, &opts->pathspec, opts->prefix)) {
379 + if (report_path_error(ps_matched, &opts->pathspec)) {
380 free(ps_matched);
381 return 1;
382 }
builtin/commit.c
+3 -3
@@ -235,7 +235,7 @@ static int commit_index_files(void)
235 * and return the paths that match the given pattern in list.
236 */
237 static int list_paths(struct string_list *list, const char *with_tree,
238 - const char *prefix, const struct pathspec *pattern)
238 + const struct pathspec *pattern)
239 {
240 int i, ret;
241 char *m;
@@ -264,7 +264,7 @@ static int list_paths(struct string_list *list, const char *with_tree,
264 item->util = item; /* better a valid pointer than a fake one */
265 }
266
267 - ret = report_path_error(m, pattern, prefix);
267 + ret = report_path_error(m, pattern);
268 free(m);
269 return ret;
270 }
@@ -454,7 +454,7 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix
454 die(_("cannot do a partial commit during a cherry-pick."));
455 }
456
457 - if (list_paths(&partial, !current_head ? NULL : "HEAD", prefix, &pathspec))
457 + if (list_paths(&partial, !current_head ? NULL : "HEAD", &pathspec))
458 exit(1);
459
460 discard_cache();
builtin/ls-files.c
+1 -1
@@ -680,7 +680,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
680
681 if (ps_matched) {
682 int bad;
683 - bad = report_path_error(ps_matched, &pathspec, prefix);
683 + bad = report_path_error(ps_matched, &pathspec);
684 if (bad)
685 fprintf(stderr, "Did you forget to 'git add'?\n");
686
builtin/submodule--helper.c
+1 -1
@@ -348,7 +348,7 @@ static int module_list_compute(int argc, const char **argv,
348 i++;
349 }
350
351 - if (ps_matched && report_path_error(ps_matched, pathspec, prefix))
351 + if (ps_matched && report_path_error(ps_matched, pathspec))
352 result = -1;
353
354 free(ps_matched);
dir.c
+1 -2
@@ -502,8 +502,7 @@ int submodule_path_match(const struct index_state *istate,
502 }
503
504 int report_path_error(const char *ps_matched,
505 - const struct pathspec *pathspec,
506 - const char *prefix)
505 + const struct pathspec *pathspec)
506 {
507 /*
508 * Make sure all pathspec matched; otherwise it is an error.
dir.h
+1 -1
@@ -220,7 +220,7 @@ extern int match_pathspec(const struct index_state *istate,
220 const struct pathspec *pathspec,
221 const char *name, int namelen,
222 int prefix, char *seen, int is_dir);
223 -extern int report_path_error(const char *ps_matched, const struct pathspec *pathspec, const char *prefix);
223 +extern int report_path_error(const char *ps_matched, const struct pathspec *pathspec);
224 extern int within_depth(const char *name, int namelen, int depth, int max_depth);
225
226 extern int fill_directory(struct dir_struct *dir,