Merge branch 'jk/maint-add-empty'
authorJunio C Hamano <gitster@pobox.com>
Mon, 18 May 2009 16:01:01 +0000 (09:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 May 2009 16:01:01 +0000 (09:01 -0700)
* jk/maint-add-empty:
add: don't complain when adding empty project root

builtin-add.c
index 314380eed054d97658d2f3256c62cd5e6880cbb0..bee45f00de7d82e07b617716033f0d5605b2a368 100644 (file)
@@ -63,7 +63,7 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p
        fill_pathspec_matches(pathspec, seen, specs);
 
        for (i = 0; i < specs; i++) {
-               if (!seen[i] && !file_exists(pathspec[i]))
+               if (!seen[i] && pathspec[i][0] && !file_exists(pathspec[i]))
                        die("pathspec '%s' did not match any files",
                                        pathspec[i]);
        }