From: Junio C Hamano Date: Tue, 29 Jan 2019 20:47:53 +0000 (-0800) Subject: Merge branch 'jk/save-getenv-result' X-Git-Tag: v2.21.0-rc0~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=773e4088819cb17150afd4929f32bccabb8e2acd;p=thirdparty%2Fgit.git Merge branch 'jk/save-getenv-result' There were many places the code relied on the string returned from getenv() to be non-volatile, which is not true, that have been corrected. * jk/save-getenv-result: builtin_diff(): read $GIT_DIFF_OPTS closer to use merge-recursive: copy $GITHEAD strings init: make a copy of $GIT_DIR string config: make a copy of $GIT_CONFIG string commit: copy saved getenv() result get_super_prefix(): copy getenv() result --- 773e4088819cb17150afd4929f32bccabb8e2acd diff --cc diff.c index 084bf54293,0920b12c0c..e8c3e8081f --- a/diff.c +++ b/diff.c @@@ -3593,10 -3495,11 +3595,11 @@@ static void builtin_diff(const char *na xecfg.ctxlen = strtoul(v, NULL, 10); else if (skip_prefix(diffopts, "-u", &v)) xecfg.ctxlen = strtoul(v, NULL, 10); + if (o->word_diff) init_diff_words_data(&ecbdata, o, one, two); - if (xdi_diff_outf(&mf1, &mf2, fn_out_consume, &ecbdata, - &xpp, &xecfg)) + if (xdi_diff_outf(&mf1, &mf2, NULL, fn_out_consume, + &ecbdata, &xpp, &xecfg)) die("unable to generate diff for %s", one->path); if (o->word_diff) free_diff_words_data(&ecbdata);