aboutsummaryrefslogtreecommitdiffstats
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-01-11 17:16:31 -0500
committerJunio C Hamano <gitster@pobox.com>2019-01-11 18:48:59 -0800
commite5b07c539deefb13a4830fe9303e3d7590713f26 (patch)
tree6c58149727a6769b5a9c20af03a165b332e1693b /commit-graph.c
parentconfig: make a copy of $GIT_CONFIG string (diff)
downloadgit-e5b07c539deefb13a4830fe9303e3d7590713f26.tar.gz
git-e5b07c539deefb13a4830fe9303e3d7590713f26.zip
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 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions
36-pathspec-in-bare.sh?h=v2.25.4&id=5c20398699165a91af2d81ea2d20385bc8dd3627&follow=1'>prefix_path: show gitdir if worktree unavailableEmily Shaffer3-4/+50 2020-03-12fsck: detect gitmodules URLs with embedded newlinesJeff King2-2/+32 2020-03-12credential: detect unrepresentable values when parsing urlsJeff King3-4/+60 2020-03-12t/lib-credential: use test_i18ncmp to check stderrJeff King1-1/+1 2020-03-12credential: avoid writing values with newlinesJeff King2-0/+8 2020-03-02show_one_mergetag: print non-parent in hex form.Harald van Dijk2-1/+21 2020-02-28Revert "gpg-interface: prefer check_signature() for GPG verification"Junio C Hamano4-72/+75 2020-02-27mingw: workaround for hangs when sending STDINAlexandr Miloslavskiy1-28/+3 2020-02-27Documentation: clarify that `-h` alone stands for `help`Junio C Hamano2-1/+8 2020-02-27Azure Pipeline: switch to the latest agent poolsJohannes Schindelin1-12/+25 2020-02-27ci: prevent `perforce` from being quarantinedJohannes Schindelin1-2/+2 2020-02-27t/lib-httpd: avoid using macOS' sedJohannes Schindelin8-59/+66 2020-02-22partial-clone: avoid fetching when looking for objectsDerrick Stolee2-6/+6 2020-02-22partial-clone: demonstrate bugs in partial fetchDerrick Stolee1-0/+31 2020-02-22run-command.h: fix mis-indented struct memberJeff King1-1/+1 2020-02-19merge-recursive: fix the refresh logic in update_file_flagsElijah Newren2-3/+6