mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 23:56:24 -04:00
Lazygit has two ways to decide whether it needs to ask the user to force-push: 1. if it knows ahead of time that the push will fail because the branch has diverged, by looking at the incoming/outgoing information that it shows as ↑3↓7. 2. by examining the error that comes back when the push has failed. The second situation should happen only rarely, because lazygit fetches every minute by default, so the ↑3↓7 information is usually up to date. It might not be if the user turned off auto-fetch (or increased the auto-fetch interval). However, in this case it's almost always harmful to prompt the user to force-push, because we know that the reason for diverging is that something was pushed to the remote, and we would wipe it out by force-pushing. In such a situation, the more likely user action is to pull the remote changes and then push normally again. So just remove the second prompt, and replace it by a better error message when we detect that updates were rejected remotely. A little bit of history archeology reveals that the second prompt was added at a time where we didn't have the first one yet, so at that time it made sense to have it; but when the first prompt was added, we should have removed the second. |
||
|---|---|---|
| .. | ||
| context | ||
| controllers | ||
| filetree | ||
| keybindings | ||
| mergeconflicts | ||
| modes | ||
| patch_exploring | ||
| popup | ||
| presentation | ||
| services/custom_commands | ||
| status | ||
| style | ||
| types | ||
| background.go | ||
| command_log_panel.go | ||
| context.go | ||
| context_config.go | ||
| controllers.go | ||
| dummies.go | ||
| editors.go | ||
| extras_panel.go | ||
| global_handlers.go | ||
| gui.go | ||
| gui_common.go | ||
| gui_driver.go | ||
| information_panel.go | ||
| keybindings.go | ||
| layout.go | ||
| main_panels.go | ||
| menu_panel.go | ||
| options_map.go | ||
| pty.go | ||
| pty_windows.go | ||
| recent_repos_panel.go | ||
| tasks_adapter.go | ||
| test_mode.go | ||
| view_helpers.go | ||
| views.go | ||