summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-11-15 12:14:28 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-11-15 12:14:28 +0900
commita6ee796aa85ef96cab1ba866e193eedfda2fb5b6 (patch)
tree4c53a76b9b1f7a44c38f51c25be63ee22a8ff191 /merge-recursive.c
parentMerge branch 'mh/avoid-rewriting-packed-refs' (diff)
parentmerge-recursive: check GIT_MERGE_VERBOSITY only once (diff)
downloadtgif-a6ee796aa85ef96cab1ba866e193eedfda2fb5b6.tar.xz
Merge branch 'ao/merge-verbosity-getenv-just-once'
Code cleanup. * ao/merge-verbosity-getenv-just-once: merge-recursive: check GIT_MERGE_VERBOSITY only once
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 2ca8444c65..b48b15a6fd 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -2201,6 +2201,7 @@ static void merge_recursive_config(struct merge_options *o)
void init_merge_options(struct merge_options *o)
{
+ const char *merge_verbosity;
memset(o, 0, sizeof(struct merge_options));
o->verbosity = 2;
o->buffer_output = 1;
@@ -2209,9 +2210,9 @@ void init_merge_options(struct merge_options *o)
o->renormalize = 0;
o->detect_rename = 1;
merge_recursive_config(o);
- if (getenv("GIT_MERGE_VERBOSITY"))
- o->verbosity =
- strtol(getenv("GIT_MERGE_VERBOSITY"), NULL, 10);
+ merge_verbosity = getenv("GIT_MERGE_VERBOSITY");
+ if (merge_verbosity)
+ o->verbosity = strtol(merge_verbosity, NULL, 10);
if (o->verbosity >= 5)
o->buffer_output = 0;
strbuf_init(&o->obuf, 0);