summaryrefslogtreecommitdiff
path: root/t/t4013/diff.diff_initial..side
diff options
context:
space:
mode:
authorMark Levedahl <mlevedahl@gmail.com>2026-05-31 19:02:16 -0400
committerJohannes Sixt <j6t@kdbg.org>2026-06-02 19:13:13 +0200
commitd4800b7a6e8eef7de8c419ffc55c631c62a902de (patch)
tree74a528554f39bcebd1c926b7ca292228bb760308 /t/t4013/diff.diff_initial..side
parenta7e5d892034b6e81dbbbaed09fdbade12352157b (diff)
git-gui: guard set/unset of GIT_DIR and GIT_WORK_TREE
git-gui unconditionally exports _gitdir as GIT_DIR, and _gitworktree as GIT_WORK_TREE, to the environment, and unconditionally unsets these environment variables before invoking gitk or git-gui when a submodule is involved. This export happens even if _gitworktree is empty, which happens when running from a bare repository. However, exporting GIT_WORK_TREE as empty is never valid, and causes errors in git. GIT_DIR must be exported if the repository is not discoverable from the worktree (or current directory if there is no worktree). The user might have configured this. If there is a worktree, git-gui makes this the current directory. However, if the repository sets core.worktree, this value can only be overridden by GIT_WORK_TREE so the latter must be exported. As we cannot eliminate conditions where either variable is needed, let's implement a pair of functions to set / unset these variables without error, and without ever exporting an empty GIT_WORK_TREE. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions