jesseduffield.lazygit/pkg/integration/tests/sync
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
..
fetch_and_auto_forward_branches_all_branches.go Fix more unstable tests 2025-07-10 08:59:01 +02:00
fetch_and_auto_forward_branches_all_branches_checked_out_in_other_worktree.go Show worktree name next to branch in branches list 2026-03-09 11:34:34 +01:00
fetch_and_auto_forward_branches_none.go Fix more unstable tests 2025-07-10 08:59:01 +02:00
fetch_and_auto_forward_branches_only_main_branches.go Fix more unstable tests 2025-07-10 08:59:01 +02:00
fetch_and_auto_forward_branches_worktree_added_after_startup.go Add test for auto-forwarding a branch checked out in another worktree 2026-05-21 13:59:18 +02:00
fetch_prune.go Fix typos 2025-01-03 10:50:36 +11:00
fetch_when_sorted_by_date.go Keep same branch selected when refreshing branches 2024-01-19 09:25:07 +01:00
force_push.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
force_push_multiple_matching.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
force_push_multiple_upstream.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
force_push_remote_branch_not_stored_locally.go Add integration test for pushing when the remote is not stored locally 2024-06-01 08:12:45 +02:00
force_push_triangular.go Remove obsolete git version restriction in test 2025-07-09 11:15:45 +02:00
pull.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
pull_and_set_upstream.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
pull_merge.go Remove ColoredBranchStatus and branchStatusColor 2024-06-03 13:02:46 +02:00
pull_merge_conflict.go Mention which command is continued in PromptToContinueRebase 2025-04-20 15:53:17 +02:00
pull_rebase.go Remove ColoredBranchStatus and branchStatusColor 2024-06-03 13:02:46 +02:00
pull_rebase_conflict.go Mention which command is continued in PromptToContinueRebase 2025-04-20 15:53:17 +02:00
pull_rebase_interactive_conflict.go Add section headers for rebase todos, cherry-picks, reverts, and actual commits 2025-04-20 16:06:15 +02:00
pull_rebase_interactive_conflict_drop.go Add section headers for rebase todos, cherry-picks, reverts, and actual commits 2025-04-20 16:06:15 +02:00
push.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
push_and_auto_set_upstream.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
push_and_set_upstream.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
push_follow_tags.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
push_no_follow_tags.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
push_tag.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
push_with_credential_prompt.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00
rename_branch_and_pull.go Use sentence case everywhere 2023-05-25 23:52:19 +10:00
shared.go More explicit test of status panel content 2024-06-03 13:02:46 +02:00