summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/diff_tform.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/diff_tform.c b/src/diff_tform.c
index 8577f06b8..6a6a62811 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -261,7 +261,7 @@ static int normalize_find_opts(
if (!given ||
(given->flags & GIT_DIFF_FIND_ALL) == GIT_DIFF_FIND_BY_CONFIG)
{
- if (diff->repo) {
+ if (cfg) {
char *rule =
git_config__get_string_force(cfg, "diff.renames", "true");
int boolval;
@@ -318,8 +318,10 @@ static int normalize_find_opts(
#undef USE_DEFAULT
if (!opts->rename_limit) {
- opts->rename_limit = git_config__get_int_force(
- cfg, "diff.renamelimit", DEFAULT_RENAME_LIMIT);
+ if (cfg) {
+ opts->rename_limit = git_config__get_int_force(
+ cfg, "diff.renamelimit", DEFAULT_RENAME_LIMIT);
+ }
if (opts->rename_limit <= 0)
opts->rename_limit = DEFAULT_RENAME_LIMIT;