Merge branch 'jk/save-getenv-result'
authorJunio C Hamano <gitster@pobox.com>
Tue, 29 Jan 2019 20:47:53 +0000 (12:47 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Jan 2019 20:47:54 +0000 (12:47 -0800)
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

1  2 
builtin/commit.c
builtin/config.c
builtin/init-db.c
diff.c
environment.c
Simple merge
Simple merge
Simple merge
diff --cc diff.c
index 084bf542931e09c03a7627740f9177e5c9fac5d9,0920b12c0c3827b55a3497924a43ada017ede20f..e8c3e8081f9be0c4e9560a834b0f3df75ca81b72
--- 1/diff.c
--- 2/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);
diff --cc environment.c
Simple merge