gitui icon indicating copy to clipboard operation
gitui copied to clipboard

fix: disable blame and history popup for untracked files

Open kpbaks opened this issue 10 months ago • 4 comments

An untracked file does not have any history data. Right now when you press B for the blame popup or the H for the history popup you get an empty popup where the title spins endlessly trying to find the file in the commit history, and show relevant information. This commit

It changes the following:

  • disables the two actions in the StatusTreeComponent, when the selected item is a file which is not tracked by git.

I followed the checklist:

  • [ ] I added unittests
  • [x] I ran make check without errors
  • [x] I tested the overall application
  • [ ] I added an appropriate item to the changelog

kpbaks avatar Jan 18 '25 19:01 kpbaks

I have run make check. The only error reported by clippy is this. image

Hope this is okay. I think it could be addressed in another PR to refactor the cognitive complexity of the event function

kpbaks avatar Jan 18 '25 20:01 kpbaks

I would add #[expect(clippy::cognitive_complexity)] to the function. make check should not fail. The refactor should be done in a future pr.

Joshix-1 avatar Jan 18 '25 20:01 Joshix-1

I have added #[expect(clippy::cognitive_complexity)] to the function. Now make check passes.

kpbaks avatar Jan 19 '25 10:01 kpbaks

@kpbaks thanks for your contribution. please add a changelog entry and its good to go

extrawurst avatar Mar 15 '25 09:03 extrawurst

Added entry to CHANGELOG.md

kpbaks avatar Aug 30 '25 21:08 kpbaks