Git guard: the shim (seam b) never reads GIT_DIR from its environment, so an export in one shell call and a push in the next reaches the clone #86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (defect): the git shim (seam b) judges a call at the repository git will really use. Today it never reads a
GIT_DIRorGIT_WORK_TREEfrom its own environment.Refs macula-io/martha#68 (found while building it; this was split out by the dispatcher, since #68 does only what was ruled, at seam a), #53 and #67 (the same class at seam a), and #48.
The class
A repository named through the environment, rather than in the shell line, is judged at the place the line was typed. The shim sends the launcher only
cwdandargs(judge_a_git_call.ts:gitCallBody(process.cwd(), args)), so theGIT_DIRthat git will use is never part of the question.The instance
Typed in a member's worktree, in two separate shell calls of one session:
GIT_DIR. #53 reads an export only within the line it carries.Whether a host carries an export from one shell call to the next is the host's business. Wherever it does, nothing judges the push. The same holds for an inline
GIT_DIR=~/x git push: the shell expands the tilde before git runs, while the seam (a) reader reads it as a wrong path (see the reader issue filed beside this one).What it touches (four guard files)
src/guard_the_git_a_member_runs/judge_a_git_call.ts: sendGIT_DIRandGIT_WORK_TREEfromprocess.envwith the call.src/guard_the_git_a_member_runs/guard_protocol.ts:gitCallBodycarries them.src/guard_the_git_a_member_runs/judge_a_guards_question.ts: read them, absolute paths only.src/guard_the_git_a_member_runs/a_call_the_guards_seams_ask_about.ts: hand them to the reader as the call'sgitDirectoryandworkTree, so ask_git and guard_workspace judge at that repository, as they already do for--git-dir.Threat model first (guard code), then red first, then a mutant on the guard. It is NOT a new refusal: the existing default-branch rule then sees the right repository.