diff options
Diffstat (limited to 'builtin-rerere.c')
-rw-r--r-- | builtin-rerere.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/builtin-rerere.c b/builtin-rerere.c index 343d6cde4..25f507a2f 100644 --- a/builtin-rerere.c +++ b/builtin-rerere.c @@ -48,6 +48,8 @@ static void garbage_collect(struct string_list *rr) git_config(git_rerere_gc_config, NULL); dir = opendir(git_path("rr-cache")); + if (!dir) + die_errno("unable to open rr-cache directory"); while ((e = readdir(dir))) { if (is_dot_or_dotdot(e->d_name)) continue; @@ -101,15 +103,27 @@ static int diff_two(const char *file1, const char *label1, int cmd_rerere(int argc, const char **argv, const char *prefix) { struct string_list merge_rr = { NULL, 0, 0, 1 }; - int i, fd; - + int i, fd, flags = 0; + + if (2 < argc) { + if (!strcmp(argv[1], "-h")) + usage(git_rerere_usage); + if (!strcmp(argv[1], "--rerere-autoupdate")) + flags = RERERE_AUTOUPDATE; + else if (!strcmp(argv[1], "--no-rerere-autoupdate")) + flags = RERERE_NOAUTOUPDATE; + if (flags) { + argc--; + argv++; + } + } if (argc < 2) - return rerere(); + return rerere(flags); - if (!strcmp(argv[1], "-h")) - usage(git_rerere_usage); + if (!strcmp(argv[1], "forget")) + return rerere_forget(argv + 2); - fd = setup_rerere(&merge_rr); + fd = setup_rerere(&merge_rr, flags); if (fd < 0) return 0; |