]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-ls-files.c
Merge branch 'maint'
[thirdparty/git.git] / builtin-ls-files.c
index 11386c432b7722301223b5a85a2cfe847bad5549..21c2a6e2d9b68c0c3bcfac824e85c7b392c72486 100644 (file)
@@ -5,28 +5,27 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include <fnmatch.h>
-
 #include "cache.h"
 #include "quote.h"
 #include "dir.h"
 #include "builtin.h"
 
-static int abbrev = 0;
-static int show_deleted = 0;
-static int show_cached = 0;
-static int show_others = 0;
-static int show_stage = 0;
-static int show_unmerged = 0;
-static int show_modified = 0;
-static int show_killed = 0;
-static int show_valid_bit = 0;
+static int abbrev;
+static int show_deleted;
+static int show_cached;
+static int show_others;
+static int show_stage;
+static int show_unmerged;
+static int show_modified;
+static int show_killed;
+static int show_valid_bit;
 static int line_terminator = '\n';
 
-static int prefix_len = 0, prefix_offset = 0;
-static const char **pathspec = NULL;
-static int error_unmatch = 0;
-static char *ps_matched = NULL;
+static int prefix_len;
+static int prefix_offset;
+static const char **pathspec;
+static int error_unmatch;
+static char *ps_matched;
 
 static const char *tag_cached = "";
 static const char *tag_unmerged = "";
@@ -486,10 +485,14 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
                for (num = 0; pathspec[num]; num++) {
                        if (ps_matched[num])
                                continue;
-                       error("pathspec '%s' did not match any.",
+                       error("pathspec '%s' did not match any file(s) known to git.",
                              pathspec[num] + prefix_offset);
                        errors++;
                }
+
+               if (errors)
+                       fprintf(stderr, "Did you forget to 'git add'?\n");
+
                return errors ? 1 : 0;
        }