jesseduffield.lazygit/pkg/commands/oscommands
Jesse Duffield 26ca41a40e Handle pending actions properly in git commands that require credentials
I don't know if this is a hack or not: we run a git command and increment the pending action
count to 1 but at some point the command requests a username or password, so we need to prompt
the user to enter that. At that point we don't want to say that there is a pending action,
so we decrement the action count before prompting the user and then re-increment it again afterward.

Given that we panic when the counter goes below zero, it's important that it's not zero
when we run the git command (should be impossible anyway).

I toyed with a different approach using channels and a long-running goroutine that
handles all commands that request credentials but it feels over-engineered compared to this
commit's approach.
2023-07-08 22:54:52 +10:00
..
cmd_obj.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
cmd_obj_builder.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
cmd_obj_runner.go Handle pending actions properly in git commands that require credentials 2023-07-08 22:54:52 +10:00
cmd_obj_runner_default.go more refactoring 2022-01-09 14:09:53 +11:00
cmd_obj_runner_test.go Handle pending actions properly in git commands that require credentials 2023-07-08 22:54:52 +10:00
cmd_obj_runner_win.go add deadlock mutex package 2022-08-07 11:16:14 +10:00
cmd_obj_test.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
copy.go Appease linter 2023-06-03 15:54:03 +10:00
dummies.go use tempdir in tests to prevent polluting worktree 2022-11-13 14:10:21 +11:00
fake_cmd_obj_runner.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
gui_io.go Handle pending actions properly in git commands that require credentials 2023-07-08 22:54:52 +10:00
os.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
os_default_platform.go update tests 2022-01-04 09:07:15 +11:00
os_default_test.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
os_test.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
os_windows.go update tests 2022-01-04 09:07:15 +11:00
os_windows_test.go Fix windows tests 2023-04-13 13:14:00 +02:00