From: Junio C Hamano Date: Thu, 26 Mar 2015 18:57:12 +0000 (-0700) Subject: Merge branch 'jc/report-path-error-to-dir' X-Git-Tag: v2.4.0-rc0~3 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=574ee8ae8636ffad8146e0f8e648b866dad725e6;p=git-core%2Fgit.git Merge branch 'jc/report-path-error-to-dir' Code clean-up. * jc/report-path-error-to-dir: report_path_error(): move to dir.c --- 574ee8ae8636ffad8146e0f8e648b866dad725e6 diff --cc builtin/ls-files.c index 914054d36,47d70b2b9..6fa220573 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@@ -354,51 -354,8 +354,8 @@@ void overlay_tree_on_cache(const char * } } - int report_path_error(const char *ps_matched, - const struct pathspec *pathspec, - const char *prefix) - { - /* - * Make sure all pathspec matched; otherwise it is an error. - */ - struct strbuf sb = STRBUF_INIT; - int num, errors = 0; - for (num = 0; num < pathspec->nr; num++) { - int other, found_dup; - - if (ps_matched[num]) - continue; - /* - * The caller might have fed identical pathspec - * twice. Do not barf on such a mistake. - * FIXME: parse_pathspec should have eliminated - * duplicate pathspec. - */ - for (found_dup = other = 0; - !found_dup && other < pathspec->nr; - other++) { - if (other == num || !ps_matched[other]) - continue; - if (!strcmp(pathspec->items[other].original, - pathspec->items[num].original)) - /* - * Ok, we have a match already. - */ - found_dup = 1; - } - if (found_dup) - continue; - - error("pathspec '%s' did not match any file(s) known to git.", - pathspec->items[num].original); - errors++; - } - strbuf_release(&sb); - return errors; - } - static const char * const ls_files_usage[] = { - N_("git ls-files [options] [...]"), + N_("git ls-files [] [...]"), NULL };