lazygit/pkg/commands/git_commands
Stefan Haller 76e39af76f Allow multiple fetch commands (or fetch and pull) to run concurrently
Git has a bug [1] whereby running multiple fetch commands at the same time
causes all of them to append their information to the .git/FETCH_HEAD file,
causing the next git pull that wants to use the information to become confused,
and show an error like "Cannot rebase onto multiple branches". This error would
occur when pressing "f" and "p" in quick succession in the files panel, but also
when pressing "p" while a background fetch happens to be running. One likely
situation for this is pressing "p" right after startup.

Since lazygit never uses the information written to .git/FETCH_HEAD, it's best
to avoid writing to it, which fixes the scenarios described above.

However, it doesn't fix the problem of repeatedly pressing "f" quickly on the
checked-out branch; since we call "git pull" in that case, the above fix doesn't
help there. We'll address this separately in another PR.

[1] See https://public-inbox.org/git/xmqqy1daffk8.fsf@gitster.g/ for more
information.
2024-01-10 09:18:38 +01:00
..
bisect.go Centralise logic for obtaining repo paths 2023-07-30 18:35:24 +10:00
bisect_info.go Standardise on using lo for slice functions 2023-07-30 18:51:23 +10:00
blame.go Add command to find base commit for creating a fixup 2024-01-10 09:11:40 +01:00
branch.go Allow deleting remote tags/branches from local tag/branch views (#2738) 2023-08-10 17:39:26 +10:00
branch_loader.go Add a sort order menu for local branches 2023-12-27 15:25:29 +01:00
branch_loader_test.go Add a sort order menu for local branches 2023-12-27 15:25:29 +01:00
branch_test.go Allow deleting remote tags/branches from local tag/branch views (#2738) 2023-08-10 17:39:26 +10:00
commit.go Add command to find base commit for creating a fixup 2024-01-10 09:11:40 +01:00
commit_file_loader.go Standardise on using lo for slice functions 2023-07-30 18:51:23 +10:00
commit_file_loader_test.go Merge loaders package into git_commands package 2022-11-14 18:11:45 +11:00
commit_loader.go Add option RefToShowDivergenceFrom to GetCommitsOptions 2023-08-29 08:16:40 +02:00
commit_loader_test.go Add option RefToShowDivergenceFrom to GetCommitsOptions 2023-08-29 08:16:40 +02:00
commit_test.go Simplify GetCommitMessage 2024-01-09 14:31:53 +01:00
common.go Remove sync mutex 2023-10-08 18:45:36 +02:00
config.go Add UserConfig jsonschema generation script 2023-12-02 10:46:24 +01:00
custom.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
deps_test.go Add AppState to common.Common 2023-09-04 17:48:39 +02:00
diff.go Add command to find base commit for creating a fixup 2024-01-10 09:11:40 +01:00
file.go use 'suspend' instead of 'editInTerminal' internally 2023-08-09 22:03:58 +10:00
file_loader.go Write unit tests with the help of afero 2023-07-30 18:35:36 +10:00
file_loader_test.go Write unit tests with the help of afero 2023-07-30 18:35:36 +10:00
file_test.go use 'suspend' instead of 'editInTerminal' internally 2023-08-09 22:03:58 +10:00
flow.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
flow_test.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
git_command_builder.go Add support for external diff commands (e.g. difftastic) 2023-09-04 16:52:30 +02:00
git_command_builder_test.go Add worktree tests for removing/detaching 2023-07-30 18:35:23 +10:00
patch.go Centralise logic for obtaining repo paths 2023-07-30 18:35:24 +10:00
rebase.go Add a method GitVersion.IsAtLeast 2024-01-10 09:18:38 +01:00
rebase_test.go Support random order of command execution in unit tests 2023-07-29 12:36:17 +10:00
reflog_commit_loader.go Refactor reflog commit loader 2023-07-29 10:04:11 +10:00
reflog_commit_loader_test.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
remote.go Remove sync mutex 2023-10-08 18:45:36 +02:00
remote_loader.go Implement a sort order menu for remote branches 2023-12-22 16:30:20 +09:00
repo_paths.go Fix test 2023-08-19 19:12:36 +03:00
repo_paths_test.go Fix test 2023-08-19 19:12:36 +03:00
stash.go Move diff context size from UserConfig to AppState 2023-09-05 13:55:30 +02:00
stash_loader.go chore: use null char as a stash entries divider during loading 2023-12-27 11:21:49 +01:00
stash_loader_test.go feat: add age on stash lines 2023-12-27 11:21:49 +01:00
stash_test.go Move diff context size from UserConfig to AppState 2023-09-05 13:55:30 +02:00
status.go Add StatusCommands.IsInNormalRebase and IsInInteractiveRebase 2023-09-18 10:50:19 +02:00
submodule.go Centralise logic for obtaining repo paths 2023-07-30 18:35:24 +10:00
sync.go Allow multiple fetch commands (or fetch and pull) to run concurrently 2024-01-10 09:18:38 +01:00
sync_test.go Use an interface for tasks instead of a concrete struct 2023-07-10 17:12:21 +10:00
tag.go Remove sync mutex 2023-10-08 18:45:36 +02:00
tag_loader.go Standardise on using lo for slice functions 2023-07-30 18:51:23 +10:00
tag_loader_test.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
version.go Add a method GitVersion.IsAtLeast 2024-01-10 09:18:38 +01:00
version_test.go Add a method GitVersion.IsAtLeast 2024-01-10 09:18:38 +01:00
working_tree.go Remove unused function 2024-01-09 14:24:14 +01:00
working_tree_test.go Move diff context size from UserConfig to AppState 2023-09-05 13:55:30 +02:00
worktree.go Centralise logic for obtaining repo paths 2023-07-30 18:35:24 +10:00
worktree_loader.go Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
worktree_loader_test.go Fix arg order to asserts 2023-08-19 19:10:25 +03:00