X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-ls-files.c;h=75ba42246ee340634d317ec39948ed983171a42f;hb=d8ad63aff0c494898f95aefb12fef25514ba7413;hp=25dbfb44999566d0491b3f870a47f7df80aa7649;hpb=1a9b8bcfb92e130b4ea67fae2d26b9569da3ed1e;p=git.git diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 25dbfb449..75ba42246 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -437,7 +437,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix) memset(&dir, 0, sizeof(dir)); if (prefix) prefix_offset = strlen(prefix); - git_config(git_default_config); + git_config(git_default_config, NULL); for (i = 1; i < argc; i++) { const char *arg = argv[i]; @@ -574,17 +574,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix) pathspec = get_pathspec(prefix, argv + i); /* Verify that the pathspec matches the prefix */ - if (pathspec) { - if (argc != i) { - int cnt; - for (cnt = 0; pathspec[cnt]; cnt++) - ; - if (cnt != (argc - i)) - exit(1); /* error message already given */ - } + if (pathspec) prefix = verify_pathspec(prefix); - } else if (argc != i) - exit(1); /* error message already given */ /* Treat unmatching pathspec elements as errors */ if (pathspec && error_unmatch) {