Merge branch 'lt/dirwalk' into next
authorJunio C Hamano <junkio@cox.net>
Thu, 18 May 2006 08:47:13 +0000 (01:47 -0700)
committerJunio C Hamano <junkio@cox.net>
Thu, 18 May 2006 08:47:13 +0000 (01:47 -0700)
* lt/dirwalk:
builtin-add: fix unmatched pathspec warnings.

1  2 
builtin-add.c
diff --combined builtin-add.c
index 7083820f7b2745708e40f624935a0ad231351e24,37243f8c3614c3840eaf6af6bac705b6980290f5..2afb82d6c1d745694f8457415e13f4f67b86ca19
@@@ -8,7 -8,6 +8,7 @@@
  #include "cache.h"
  #include "builtin.h"
  #include "dir.h"
 +#include "cache-tree.h"
  
  static const char builtin_add_usage[] =
  "git-add [-n] [-v] <filepattern>...";
@@@ -124,7 -123,7 +124,7 @@@ static void prune_directory(struct dir_
  
                /* 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);
        }
@@@ -198,7 -197,6 +198,7 @@@ static int add_file_to_index(const cha
                die("unable to add %s to index",path);
        if (verbose)
                printf("add '%s'\n", path);
 +      cache_tree_invalidate_path(active_cache_tree, path);
        return 0;
  }