static int diff_color_moved_default;
static int diff_color_moved_ws_default;
static int diff_context_default = 3;
-static int diff_interhunk_context_default;
+static unsigned int diff_interhunk_context_default;
static char *diff_word_regex_cfg;
static struct external_diff external_diff_cfg;
static char *diff_order_file_cfg;
return 0;
}
if (!strcmp(var, "diff.interhunkcontext")) {
- diff_interhunk_context_default = git_config_int(var, value,
- ctx->kvi);
- if (diff_interhunk_context_default < 0)
+ int val = git_config_int(var, value, ctx->kvi);
+ if (val < 0)
return -1;
+ diff_interhunk_context_default = val;
return 0;
}
if (!strcmp(var, "diff.renames")) {
OPT_CALLBACK_F(0, "default-prefix", options, NULL,
N_("use default prefixes a/ and b/"),
PARSE_OPT_NONEG | PARSE_OPT_NOARG, diff_opt_default_prefix),
- OPT_INTEGER_F(0, "inter-hunk-context", &options->interhunkcontext,
- N_("show context between diff hunks up to the specified number of lines"),
- PARSE_OPT_NONEG),
+ OPT_UNSIGNED(0, "inter-hunk-context", &options->interhunkcontext,
+ N_("show context between diff hunks up to the specified number of lines")),
OPT_CALLBACK_F(0, "output-indicator-new",
&options->output_indicators[OUTPUT_INDICATOR_NEW],
N_("<char>"),