builtin/commit.c: extract ignore_non_trailer() helper function
[gitweb.git] / builtin / add.c
index 226f758869358444ad1c39e5e0a05c961fb76859..d7e3e44d06cdf56ac661600788cfdf751037226e 100644 (file)
@@ -544,7 +544,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 
                for (i = 0; i < pathspec.nr; i++) {
                        const char *path = pathspec.items[i].match;
-                       if (!seen[i] &&
+                       if (!seen[i] && path[0] &&
                            ((pathspec.items[i].magic &
                              (PATHSPEC_GLOB | PATHSPEC_ICASE)) ||
                             !file_exists(path))) {