Merge branch 'kg/external-diff-save-env'

The code to drive GIT_EXTERNAL_DIFF command relied on the string
returned from getenv() to be non-volatile, which is not true, that
has been corrected.

* kg/external-diff-save-env:
  diff: ensure correct lifetime of external_diff_cmd
This commit is contained in:
Junio C Hamano 2019-01-29 12:47:51 -08:00
Родитель 16a465bc01 6776a84dae
Коммит 6a015cecbe
1 изменённых файлов: 1 добавлений и 1 удалений

2
diff.c
Просмотреть файл

@ -493,7 +493,7 @@ static const char *external_diff(void)
if (done_preparing)
return external_diff_cmd;
external_diff_cmd = getenv("GIT_EXTERNAL_DIFF");
external_diff_cmd = xstrdup_or_null(getenv("GIT_EXTERNAL_DIFF"));
if (!external_diff_cmd)
external_diff_cmd = external_diff_cmd_cfg;
done_preparing = 1;