From 60f8286825191ed333f146be45f5c1b307fa858c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 3 Jan 2026 06:56:08 +0000 Subject: [PATCH] Preserve original TMPDIR value when setting temporary directory Improve git_clone_scripts to save and restore the original TMPDIR value instead of unconditionally unsetting it, avoiding unintended side effects. Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> --- shell/share.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shell/share.sh b/shell/share.sh index 88cc8abd..2923b2bb 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -259,10 +259,15 @@ git_clone_scripts() { set_proxy "$proxy" # Set TMPDIR to /tmp to avoid "unable to get random bytes" error in some Docker environments + local original_tmpdir="${TMPDIR:-}" export TMPDIR=/tmp git clone -q --depth=1 $part_cmd $url $dir exit_status=$? - unset TMPDIR + if [[ -n "$original_tmpdir" ]]; then + export TMPDIR="$original_tmpdir" + else + unset TMPDIR + fi unset_proxy }