diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-12-04 00:20:48 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-12-04 00:20:48 -0800 |
commit | cb6020bb017405cc3e7f1faea6f30d4fd1b62e70 (patch) | |
tree | e03a7afb1884d2b4f8f1e45ee6a945baebd95806 /builtin-rerere.c | |
parent | 1a56be134f9477296a7ade040e8b802bf3a643a1 (diff) | |
download | git-cb6020bb017405cc3e7f1faea6f30d4fd1b62e70.tar.gz git-cb6020bb017405cc3e7f1faea6f30d4fd1b62e70.tar.xz |
Teach --[no-]rerere-autoupdate option to merge, revert and friends
Introduce a command line option to override rerere.autoupdate configuration
variable to make it more useful.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-rerere.c')
-rw-r--r-- | builtin-rerere.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/builtin-rerere.c b/builtin-rerere.c index 343d6cde4..7ec602cf5 100644 --- a/builtin-rerere.c +++ b/builtin-rerere.c @@ -101,15 +101,24 @@ 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(); - - if (!strcmp(argv[1], "-h")) - usage(git_rerere_usage); + return rerere(flags); - fd = setup_rerere(&merge_rr); + fd = setup_rerere(&merge_rr, flags); if (fd < 0) return 0; |