jesseduffield.lazygit/pkg
Stefan Haller 532cce4873 Add test for auto-forwarding a branch checked out in another worktree
When the linked worktree's branch is changed externally — by another
shell, by another tool, or by git running outside lazygit — lazygit's
worktrees model goes stale. The next post-fetch auto-forward then
doesn't realise the branch is now checked out elsewhere, and advances
its ref behind the worktree's back. The worktree's HEAD then resolves
to a commit its index/working tree haven't been updated to, and the
user sees that diff as the inverse of what was fetched — files
appearing as pending changes that they didn't make.

The test sets up a linked worktree initially on a side branch, then
externally checks out master in it before pressing fetch. Two
EXPECTED/ACTUAL pairs capture the symptoms: the branches view shows
master as `✓` rather than `↓1`, and switching to the linked worktree
shows master's would-be incoming file as a pending deletion against
HEAD.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 13:59:18 +02:00
..
app Change a-enter keybinding to m-enter on mac, and c-enter elsewhere 2026-04-30 22:22:53 +02:00
cheatsheet Remove the keybindings legend in the cheatsheets 2026-04-30 22:38:53 +02:00
commands Optimize regex compilations 2026-05-10 15:28:14 +02:00
common Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
config Validate that gui.spinner.frames must all have the same width 2026-05-06 18:53:32 +02:00
constants Make the links in the status panel point to the current version rather than master 2024-03-22 08:13:59 +01:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes Modernize all codes 2025-11-15 10:46:23 +01:00
gocui When drawing tainted views in ForceFlushViewsContentOnly, also draw views that overlap them 2026-05-09 13:58:33 +02:00
gui Extract BranchesHelper.PostFetchRefresh to unify the two fetch paths 2026-05-21 13:57:46 +02:00
i18n Revert the change of <ctrl+j>/<ctrl+k> to <alt+down>/<alt+up> 2026-05-04 18:17:37 +02:00
integration Add test for auto-forwarding a branch checked out in another worktree 2026-05-21 13:59:18 +02:00
jsonschema Modernize all codes 2025-11-15 10:46:23 +01:00
logs Fix linter warnings about ignoring errors from bufio.Scanner 2026-05-03 16:57:24 +02:00
snake Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
tasks Fix linter warnings about ignoring errors from bufio.Scanner 2026-05-03 16:57:24 +02:00
theme Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Make UnixToDateSmart timezone-deterministic 2026-05-02 17:59:27 +02:00