Junio C Hamano | 42f7740 | 2006-08-15 21:38:07 -0700 | [diff] [blame] | 1 | #include "cache.h" |
| 2 | |
| 3 | int main(int ac, char **av) |
| 4 | { |
| 5 | int i; |
| 6 | int dirty, clean, racy; |
| 7 | |
| 8 | dirty = clean = racy = 0; |
| 9 | read_cache(); |
| 10 | for (i = 0; i < active_nr; i++) { |
| 11 | struct cache_entry *ce = active_cache[i]; |
| 12 | struct stat st; |
| 13 | |
| 14 | if (lstat(ce->name, &st)) { |
| 15 | error("lstat(%s): %s", ce->name, strerror(errno)); |
| 16 | continue; |
| 17 | } |
| 18 | |
| 19 | if (ce_match_stat(ce, &st, 0)) |
| 20 | dirty++; |
Junio C Hamano | 4bd5b7d | 2007-11-10 00:15:03 -0800 | [diff] [blame] | 21 | else if (ce_match_stat(ce, &st, CE_MATCH_RACY_IS_DIRTY)) |
Junio C Hamano | 42f7740 | 2006-08-15 21:38:07 -0700 | [diff] [blame] | 22 | racy++; |
| 23 | else |
| 24 | clean++; |
| 25 | } |
| 26 | printf("dirty %d, clean %d, racy %d\n", dirty, clean, racy); |
| 27 | return 0; |
| 28 | } |