merge-recursive: check GIT_MERGE_VERBOSITY only once
Get rid of the duplicated getenv('GIT_MERGE_VERBOSITY') calls with the same constant string argument. This makes code more readable and prevents typo in the further development. Signed-off-by: Andrey Okoshkin <a.okoshkin@samsung.com> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
42e6fde5c2
commit
804862209b
@ -2162,6 +2162,7 @@ static void merge_recursive_config(struct merge_options *o)
|
|||||||
|
|
||||||
void init_merge_options(struct merge_options *o)
|
void init_merge_options(struct merge_options *o)
|
||||||
{
|
{
|
||||||
|
const char *merge_verbosity;
|
||||||
memset(o, 0, sizeof(struct merge_options));
|
memset(o, 0, sizeof(struct merge_options));
|
||||||
o->verbosity = 2;
|
o->verbosity = 2;
|
||||||
o->buffer_output = 1;
|
o->buffer_output = 1;
|
||||||
@ -2170,9 +2171,9 @@ void init_merge_options(struct merge_options *o)
|
|||||||
o->renormalize = 0;
|
o->renormalize = 0;
|
||||||
o->detect_rename = 1;
|
o->detect_rename = 1;
|
||||||
merge_recursive_config(o);
|
merge_recursive_config(o);
|
||||||
if (getenv("GIT_MERGE_VERBOSITY"))
|
merge_verbosity = getenv("GIT_MERGE_VERBOSITY");
|
||||||
o->verbosity =
|
if (merge_verbosity)
|
||||||
strtol(getenv("GIT_MERGE_VERBOSITY"), NULL, 10);
|
o->verbosity = strtol(merge_verbosity, NULL, 10);
|
||||||
if (o->verbosity >= 5)
|
if (o->verbosity >= 5)
|
||||||
o->buffer_output = 0;
|
o->buffer_output = 0;
|
||||||
strbuf_init(&o->obuf, 0);
|
strbuf_init(&o->obuf, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user