jesseduffield.lazygit/pkg/commands
Stefan Haller 34d41b5d51 Don't let our repo answer for a different one
GIT_DIR and GIT_WORK_TREE tell git where our repo is, and every command
we run inherits them — including the ones we point at a submodule or
another worktree. git resolves those against our repo instead, and says
nothing about it: with GIT_DIR set, `git -C mysub log -1` reports the
superproject's commit. So opening lazygit with --git-dir/--work-tree
quietly broke resolving submodule conflicts, stashing and resetting a
submodule, and detaching another worktree; the worktree list came back
claiming every worktree shared our git dir.

Drop the two variables from the commands that address another repo.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 11:15:01 +02:00
..
direnv Offer direnv .envrc approval from inside lazygit 2026-06-04 09:05:01 +02:00
git_commands Don't let our repo answer for a different one 2026-08-08 11:15:01 +02:00
git_config Pin the cached git config's commands to the repo directory 2026-07-20 17:07:39 +02:00
hosting_service Optimize regex compilations 2026-05-10 15:28:14 +02:00
models Carry aggregate check state with GitHub pull requests 2026-07-31 09:01:44 +02:00
oscommands Start all commands of a pipeline before waiting for any of them 2026-08-06 14:34:47 +02:00
patch Guard the patch builder against concurrent access 2026-07-17 12:35:54 +02:00
testdata Support opening lazygit in a submodule 2019-05-12 17:59:49 +10:00
git.go Recognize a repo that has no work tree instead of bailing out 2026-08-08 11:15:01 +02:00
git_cmd_obj_builder.go Pin git commands to the repo they were created for 2026-07-20 17:07:39 +02:00
git_cmd_obj_builder_test.go Pin git commands to the repo they were created for 2026-07-20 17:07:39 +02:00
git_cmd_obj_runner.go Back off exponentially between lock-error retries 2026-07-15 10:08:44 +02:00
git_cmd_obj_runner_test.go Back off exponentially between lock-error retries 2026-07-15 10:08:44 +02:00