builtin-add: fix unmatched pathspec warnings.
[gitweb.git] / builtin-add.c
index 089c7a89b324ee3cfd64aec9fe2cfba4314d2f3b..37243f8c3614c3840eaf6af6bac705b6980290f5 100644 (file)
@@ -123,7 +123,7 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p
 
                /* Existing file? We must have ignored it */
                match = pathspec[i];
-               if (!lstat(match, &st))
+               if (!match[0] || !lstat(match, &st))
                        continue;
                die("pathspec '%s' did not match any files", match);
        }