Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-01-12 01:16:31 +0300
committerJunio C Hamano <gitster@pobox.com>2019-01-12 05:48:59 +0300
commite5b07c539deefb13a4830fe9303e3d7590713f26 (patch)
tree6c58149727a6769b5a9c20af03a165b332e1693b /builtin/merge-recursive.c
parent423ff9bef003b41f81949e7a88d7278b48334ed4 (diff)
init: make a copy of $GIT_DIR string
We pass the result of getenv("GIT_DIR") to init_db() and assume that the string remains valid. But that's not guaranteed across calls to setenv() or even getenv(), although it often works in practice. Let's make a copy of the string so that we follow the rules. Note that we need to mark it with UNLEAK(), since the value persists until the end of program (but we have no opportunity to free it). This patch also handles $GIT_WORK_TREE the same way. It actually doesn't have as long a lifetime and is probably fine, but it's simpler to just treat the two side-by-side variables the same. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge-recursive.c')
0 files changed, 0 insertions, 0 deletions