Skip to content

Commit c5c3350

Browse files
peffgitster
authored andcommitted
report_path_error(): drop unused prefix parameter
This hasn't been used since 17ddc66 (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>
1 parent df351c6 commit c5c3350

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int checkout_paths(const struct checkout_opts *opts,
376376
ps_matched,
377377
opts);
378378

379-
if (report_path_error(ps_matched, &opts->pathspec, opts->prefix)) {
379+
if (report_path_error(ps_matched, &opts->pathspec)) {
380380
free(ps_matched);
381381
return 1;
382382
}

builtin/commit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static int commit_index_files(void)
235235
* and return the paths that match the given pattern in list.
236236
*/
237237
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)
239239
{
240240
int i, ret;
241241
char *m;
@@ -264,7 +264,7 @@ static int list_paths(struct string_list *list, const char *with_tree,
264264
item->util = item; /* better a valid pointer than a fake one */
265265
}
266266

267-
ret = report_path_error(m, pattern, prefix);
267+
ret = report_path_error(m, pattern);
268268
free(m);
269269
return ret;
270270
}
@@ -454,7 +454,7 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix
454454
die(_("cannot do a partial commit during a cherry-pick."));
455455
}
456456

457-
if (list_paths(&partial, !current_head ? NULL : "HEAD", prefix, &pathspec))
457+
if (list_paths(&partial, !current_head ? NULL : "HEAD", &pathspec))
458458
exit(1);
459459

460460
discard_cache();

builtin/ls-files.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
680680

681681
if (ps_matched) {
682682
int bad;
683-
bad = report_path_error(ps_matched, &pathspec, prefix);
683+
bad = report_path_error(ps_matched, &pathspec);
684684
if (bad)
685685
fprintf(stderr, "Did you forget to 'git add'?\n");
686686

builtin/submodule--helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static int module_list_compute(int argc, const char **argv,
348348
i++;
349349
}
350350

351-
if (ps_matched && report_path_error(ps_matched, pathspec, prefix))
351+
if (ps_matched && report_path_error(ps_matched, pathspec))
352352
result = -1;
353353

354354
free(ps_matched);

dir.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,7 @@ int submodule_path_match(const struct index_state *istate,
502502
}
503503

504504
int report_path_error(const char *ps_matched,
505-
const struct pathspec *pathspec,
506-
const char *prefix)
505+
const struct pathspec *pathspec)
507506
{
508507
/*
509508
* Make sure all pathspec matched; otherwise it is an error.

dir.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ extern int match_pathspec(const struct index_state *istate,
220220
const struct pathspec *pathspec,
221221
const char *name, int namelen,
222222
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);
224224
extern int within_depth(const char *name, int namelen, int depth, int max_depth);
225225

226226
extern int fill_directory(struct dir_struct *dir,

0 commit comments

Comments
 (0)