Re: [PATCH v6 3/3] git-gui: handle GIT_DIR and GIT_WORK_TREE early
- From
- Shroom Moo <egg_mushroomcow@foxmail.com>
- Date
- May 9, 2026, 09:55 UTC
- Message-ID
- <tencent_CAC52D0829E651C1CF21A1B94AEDF00D6E07@qq.com>
- In-Reply-To
- <20260509084846.1694-1-bootaina702@gmail.com>
These are functional, yet somewhat complex. Only 1 and 2 are necessary in this adjustment, I suppose.
Saving and restoring old values in do_gitk and do_git_gui actually
does not require additional encapsulation because:
- First, GIT_DIR always exists, and directly using set and catch
{unset} is inherently safe.
- Second, the set/unset operations for GIT_WORK_TREE are already
properly encapsulated. Since the save-restore pattern only appears in these two places, introducing capture_git_env / restore_git_env adds more conceptual overhead than what it saves.
Shroom