report_path_error(): drop unused prefix parameter
authorJeff King <peff@peff.net>
Wed, 20 Mar 2019 08:15:48 +0000 (04:15 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Mar 2019 09:34:09 +0000 (18:34 +0900)
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>
builtin/checkout.c
builtin/commit.c
builtin/ls-files.c
builtin/submodule--helper.c
dir.c
dir.h
index 0e6037b2968f326ca2781fa141d74683e52c983c..72f7110fd80a38431734b8996a9b2f1f6c7887a0 100644 (file)
@@ -376,7 +376,7 @@ static int checkout_paths(const struct checkout_opts *opts,
                                                        ps_matched,
                                                        opts);
 
-       if (report_path_error(ps_matched, &opts->pathspec, opts->prefix)) {
+       if (report_path_error(ps_matched, &opts->pathspec)) {
                free(ps_matched);
                return 1;
        }
index f17537474a9d0ed9672393fc5dc3845932dd4dd4..a138ff85b0b699575f4e4f19094fa245a987833d 100644 (file)
@@ -235,7 +235,7 @@ static int commit_index_files(void)
  * and return the paths that match the given pattern in list.
  */
 static int list_paths(struct string_list *list, const char *with_tree,
-                     const char *prefix, const struct pathspec *pattern)
+                     const struct pathspec *pattern)
 {
        int i, ret;
        char *m;
@@ -264,7 +264,7 @@ static int list_paths(struct string_list *list, const char *with_tree,
                        item->util = item; /* better a valid pointer than a fake one */
        }
 
-       ret = report_path_error(m, pattern, prefix);
+       ret = report_path_error(m, pattern);
        free(m);
        return ret;
 }
@@ -454,7 +454,7 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix
                        die(_("cannot do a partial commit during a cherry-pick."));
        }
 
-       if (list_paths(&partial, !current_head ? NULL : "HEAD", prefix, &pathspec))
+       if (list_paths(&partial, !current_head ? NULL : "HEAD", &pathspec))
                exit(1);
 
        discard_cache();
index 29a8762d46eb7aa9a9b456e2564062fdbdb48a06..37a08c714bf02809f4bbdaf101f2ffce2af857ab 100644 (file)
@@ -680,7 +680,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
 
        if (ps_matched) {
                int bad;
-               bad = report_path_error(ps_matched, &pathspec, prefix);
+               bad = report_path_error(ps_matched, &pathspec);
                if (bad)
                        fprintf(stderr, "Did you forget to 'git add'?\n");
 
index 6bcc4f1bd773b38f5895d3404419e362ded63d2a..8342b78add833808ebe71d7862639290c4b7a677 100644 (file)
@@ -348,7 +348,7 @@ static int module_list_compute(int argc, const char **argv,
                        i++;
        }
 
-       if (ps_matched && report_path_error(ps_matched, pathspec, prefix))
+       if (ps_matched && report_path_error(ps_matched, pathspec))
                result = -1;
 
        free(ps_matched);
diff --git a/dir.c b/dir.c
index b2cabadf2503b22cc10b3e47c548a5904d77158e..5286f710ccd708ec25f1f075c61f261c19654148 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -502,8 +502,7 @@ int submodule_path_match(const struct index_state *istate,
 }
 
 int report_path_error(const char *ps_matched,
-                     const struct pathspec *pathspec,
-                     const char *prefix)
+                     const struct pathspec *pathspec)
 {
        /*
         * Make sure all pathspec matched; otherwise it is an error.
diff --git a/dir.h b/dir.h
index e3ec26143db26f3b8c300627a3c9557b08a17edb..823bae628bc8db03dee6ef0c5601b05a6ea942f5 100644 (file)
--- a/dir.h
+++ b/dir.h
@@ -220,7 +220,7 @@ extern int match_pathspec(const struct index_state *istate,
                          const struct pathspec *pathspec,
                          const char *name, int namelen,
                          int prefix, char *seen, int is_dir);
-extern int report_path_error(const char *ps_matched, const struct pathspec *pathspec, const char *prefix);
+extern int report_path_error(const char *ps_matched, const struct pathspec *pathspec);
 extern int within_depth(const char *name, int namelen, int depth, int max_depth);
 
 extern int fill_directory(struct dir_struct *dir,