Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable blame and history popup for untracked files #2489

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kpbaks
Copy link

@kpbaks kpbaks commented Jan 18, 2025

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
  • I ran make check without errors
  • I tested the overall application
  • I added an appropriate item to the changelog

@kpbaks
Copy link
Author

kpbaks commented Jan 18, 2025

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

@Joshix-1
Copy link
Contributor

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

@kpbaks
Copy link
Author

kpbaks commented Jan 19, 2025

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

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 disables the two actions in the `StatusTreeComponent`, when the
selected item is a file which is not tracked by git.
@kpbaks kpbaks force-pushed the bugfix/disable-blame-history-popup-for-untracked-files branch from 42254f7 to 97d5e5b Compare January 22, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants