1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00
lazygit/pkg/commands
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
..
git_commands Use comment char config on interactive rebase 2023-07-02 02:07:32 -03:00
git_config remove deprecated calls 2022-09-17 15:10:41 -07:00
hosting_service Update gitlab commit URL to match new routing 2023-05-22 07:39:47 +03:30
models Support filtering files 2023-07-03 12:54:13 +10:00
oscommands Handle pending actions properly in git commands that require credentials 2023-07-08 22:54:52 +10:00
patch Refactor interface for ApplyPatch 2023-05-20 20:54:39 +10:00
testdata Support opening lazygit in a submodule 2019-05-12 17:59:49 +10:00
types/enums more refactoring 2022-01-04 09:07:15 +11:00
git_cmd_obj_builder.go Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
git_cmd_obj_runner.go fix(loaders/file.go): changed to ignore stderr when loading git status 2022-09-19 18:46:32 +09:00
git_test.go feat: add GitVersion struct 2022-12-30 20:01:14 +09:00
git.go Use comment char config on interactive rebase 2023-07-02 02:07:32 -03:00