]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff.c
cache.h: clarify documentation for git_path, et al
[thirdparty/git.git] / diff.c
diff --git a/diff.c b/diff.c
index 87b16d5613adb9046501a1b0b285f9f954abbaa5..7deac90532234996088ae847b32ce07f5ba36339 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -3653,7 +3653,12 @@ static void enable_patch_output(int *fmt) {
 
 static int parse_one_token(const char **arg, const char *token)
 {
-       return skip_prefix(*arg, token, arg) && (!**arg || **arg == ',');
+       const char *rest;
+       if (skip_prefix(*arg, token, &rest) && (!*rest || *rest == ',')) {
+               *arg = rest;
+               return 1;
+       }
+       return 0;
 }
 
 static int parse_ws_error_highlight(struct diff_options *opt, const char *arg)
@@ -3815,9 +3820,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
                DIFF_OPT_SET(options, FIND_COPIES_HARDER);
        else if (!strcmp(arg, "--follow"))
                DIFF_OPT_SET(options, FOLLOW_RENAMES);
-       else if (!strcmp(arg, "--no-follow"))
+       else if (!strcmp(arg, "--no-follow")) {
                DIFF_OPT_CLR(options, FOLLOW_RENAMES);
-       else if (!strcmp(arg, "--color"))
+               DIFF_OPT_CLR(options, DEFAULT_FOLLOW_RENAMES);
+       } else if (!strcmp(arg, "--color"))
                options->use_color = 1;
        else if (skip_prefix(arg, "--color=", &arg)) {
                int value = git_config_colorbool(NULL, arg);