X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-ls-files.c;h=e8d568eed7ab700bc338af8f589d2f61e81f323c;hb=847d10f56d7853cd0e139a7c2e6ad0ad2de5c464;hp=25dbfb44999566d0491b3f870a47f7df80aa7649;hpb=9e7bd0110b41f9bb16377e322300629f8c4d6c12;p=git.git diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 25dbfb449..e8d568eed 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -423,7 +423,7 @@ int report_path_error(const char *ps_matched, const char **pathspec, int prefix_ } static const char ls_files_usage[] = - "git-ls-files [-z] [-t] [-v] (--[cached|deleted|others|stage|unmerged|killed|modified])* " + "git ls-files [-z] [-t] [-v] (--[cached|deleted|others|stage|unmerged|killed|modified])* " "[ --ignored ] [--exclude=] [--exclude-from=] " "[ --exclude-per-directory= ] [--exclude-standard] " "[--full-name] [--abbrev] [--] []*"; @@ -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) {