Suggest single tracked commit message only when nothing else is staged (#36347)

Closes #36341

<img width="543" height="548" alt="image"
src="https://github.com/user-attachments/assets/ab76a32c-c622-4025-9b28-5accc8d3f04c"
/>

In the case where commit message was suggested based on single tracked
entry, this PR adds a clause to the condition to ensure there are no
staged entries.

Release Notes:

- Fixed commit message suggestion when there is one unstaged tracked
file, but multiple untracked files are staged.
This commit is contained in:
Mahmud Ridwan 2025-08-18 15:54:45 +06:00 committed by GitHub
parent b8a106632f
commit 2075627d6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1833,7 +1833,9 @@ impl GitPanel {
let git_status_entry = if let Some(staged_entry) = &self.single_staged_entry {
Some(staged_entry)
} else if let Some(single_tracked_entry) = &self.single_tracked_entry {
} else if self.total_staged_count() == 0
&& let Some(single_tracked_entry) = &self.single_tracked_entry
{
Some(single_tracked_entry)
} else {
None