@matheusbsbs / matheus-bagliano / commits / 6b06d518ca
Fork 0

Add read_cache to builtin-check-attr

We can now read .gitattributes files out of the index, but the index must be loaded for this to work. Signed-off-by: Brian Downing <bdowning@lavos.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brian Downing committed Aug 14, 2007 at 08:18 UTC 6b06d518caa6ef98cc0efb796713d0a0693895bf
1 file changed +5
builtin-check-attr.c
+5
@@ -1,4 +1,5 @@
1 #include "builtin.h"
2 +#include "cache.h"
3 #include "attr.h"
4 #include "quote.h"
5
@@ -10,6 +11,10 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix)
11 struct git_attr_check *check;
12 int cnt, i, doubledash;
13
14 + if (read_cache() < 0) {
15 + die("invalid cache");
16 + }
17 +
18 doubledash = -1;
19 for (i = 1; doubledash < 0 && i < argc; i++) {
20 if (!strcmp(argv[i], "--"))