jesseduffield.lazygit/pkg/commands
Stefan Haller 785c8a712c Explain when a submodule has nothing stageable
A submodule that only has dirty or untracked content (no new commit) can't
be staged from the parent repo, but it still shows up as having unstaged
changes. Pressing stage on it therefore briefly flashed as staged and then
reverted, without explaining why nothing was staged.

Detect this case (via `git submodule status`, where a '+' prefix marks a
stageable commit change) in the shared stage/unstage decision: if the only
thing that looks stageable is such a submodule, don't try to stage it.
Instead unstage if there's anything staged to unstage, so the toggle stays
symmetric; otherwise show an error explaining that there's nothing to stage.

Because the decision is shared, this covers both the stage (space) and
stage-all (a) keybindings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 09:12:09 +02:00
..
direnv Offer direnv .envrc approval from inside lazygit 2026-06-04 09:05:01 +02:00
git_commands Explain when a submodule has nothing stageable 2026-06-04 09:12:09 +02:00
git_config Enable errorlint linter, and fix warnings 2025-06-30 18:30:11 +02:00
hosting_service Optimize regex compilations 2026-05-10 15:28:14 +02:00
models Add PushUrls field to models.Remote 2026-05-04 13:09:47 +02:00
oscommands Fix linter warnings about ignoring errors from bufio.Scanner 2026-05-03 16:57:24 +02:00
patch Fix selection after staging an added line 2026-03-19 16:57:53 +01:00
testdata Support opening lazygit in a submodule 2019-05-12 17:59:49 +10:00
git.go Add GitHub commands and model for fetching PR status 2026-04-01 09:13:55 +02:00
git_cmd_obj_builder.go Remove ICmdObj interface 2025-05-01 15:21:37 +02:00
git_cmd_obj_runner.go retry on ref lock errors during fetch/pull 2026-04-20 09:04:50 +02:00