mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-11 16:16:28 -04:00
git finds a repo by looking for a .git in the directory a command runs
in. Lazygit runs its commands in the work tree, so that normally works —
but not when the git dir lives somewhere else entirely, which is what
core.worktree and --work-tree are for. Lazygit chdir'd into such a work
tree and then ran commands that couldn't see any repo from there, so
opening a repo with core.worktree set panicked on startup. It only
worked with --git-dir because that leaves GIT_DIR in the environment for
every command to inherit.
Work out at startup whether git can find the repo from its work tree,
and when it can't, put GIT_DIR and GIT_WORK_TREE on every command the
repo's builder produces. As with the working directory the builder pins
(
|
||
|---|---|---|
| .. | ||
| add_for_existing_branch.go | ||
| add_from_branch.go | ||
| add_from_branch_detached.go | ||
| add_from_commit.go | ||
| add_from_remote_branch.go | ||
| add_from_stash.go | ||
| add_from_tag.go | ||
| associate_branch_bisect.go | ||
| associate_branch_rebase.go | ||
| bare_repo.go | ||
| bare_repo_worktree_config.go | ||
| crud.go | ||
| custom_command.go | ||
| default_path_tilde.go | ||
| detach_worktree_from_branch.go | ||
| dotfile_bare_repo.go | ||
| double_nested_linked_submodule.go | ||
| exclude_file_in_worktree.go | ||
| fast_forward_worktree_branch.go | ||
| fast_forward_worktree_branch_should_not_pollute_current_worktree.go | ||
| force_remove_worktree.go | ||
| force_remove_worktree_with_submodules.go | ||
| location_candidates.go | ||
| new_worktree_picker.go | ||
| new_worktree_picker_remote.go | ||
| remove_worktree_and_both_branches.go | ||
| remove_worktree_and_branch.go | ||
| remove_worktree_and_delete_local_and_remote_branch.go | ||
| remove_worktree_from_branch.go | ||
| reset_window_tabs.go | ||
| separate_work_tree_config.go | ||
| symlink_into_repo_subdir.go | ||
| worktree_in_repo.go | ||