jesseduffield.lazygit/pkg/integration/tests/submodule
Stefan Haller d2d5bdc2bc Identify the current and main worktree by git dir, not by path
`git worktree list` reports the main worktree as the common git dir with
a trailing "/.git" removed, which equals the working tree only when the
git dir sits inside it. In a submodule, a bare repo, or a repo using
core.worktree it doesn't, so comparing the reported path against the
working tree path matches nothing: no worktree is recognized as current
or as main. Most visibly, inside a submodule lazygit claimed we were in
a linked worktree named after the submodule, and offered to remove that
"worktree".

Comparing git dirs identifies a worktree unambiguously, so use that.
A worktree whose directory is gone has no git dir to compare, and there
we still have nothing better than its path.

The submodule tests were asserting the linked-worktree suffix in the
status view; it is gone now, and the repo name still says which
submodule we're in.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 11:15:01 +02:00
..
add.go Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01:00
enter.go Identify the current and main worktree by git dir, not by path 2026-08-08 11:15:01 +02:00
enter_nested.go Identify the current and main worktree by git dir, not by path 2026-08-08 11:15:01 +02:00
remove.go Add integration test 2025-04-07 09:42:19 +02:00
remove_nested.go Make file sort order and case sensitivity configurable 2026-03-30 17:53:25 +02:00
reset.go Identify the current and main worktree by git dir, not by path 2026-08-08 11:15:01 +02:00
reset_folder.go Update disabled message 2025-04-07 09:42:19 +02:00
resolve_conflict.go Show per-side commit logs for submodule conflicts in the main view 2026-06-28 16:12:36 +02:00
resolve_conflict_rewound_side.go Show per-side commit logs for submodule conflicts in the main view 2026-06-28 16:12:36 +02:00
shared.go Show all submodules recursively 2024-03-07 20:16:28 +01:00
stage.go Also verify stage-all can unstage a dirty submodule 2026-06-04 09:12:09 +02:00
stage_all_with_dirty_submodule.go Explain when a submodule has nothing stageable 2026-06-04 09:12:09 +02:00
stage_dirty_only.go Explain when a submodule has nothing stageable 2026-06-04 09:12:09 +02:00