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(FileSettingsCache): Always watch repo-local settings #11781

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

mstv
Copy link
Member

@mstv mstv commented Jun 4, 2024

Fixes #11720

Proposed changes

Cleanup FileSettingsCache:

  • Always watch the settings file also if the checkout does not contain that file on startup (repo open)
  • Hence remove _canEnableFileWatcher
  • React on deletion, too
  • There is no need to distinguish the kind of file change because we just need to know whether to refresh the settings or not
  • Use FileChanged instead of assigning _lastFileModificationDate

Screenshots

N/A

Test methodology

  • manual
  • Remove obsolete testcase ctor_CanEnableFileWatcher_should_be_false_if_invalid_dir which is redundant with the existing
    ctor_FileWatcher_EnableRaisingEvents_should_be_false_if_invalid_dir

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

also if checkout on startup does not contain that file
@mstv mstv force-pushed the fix/11720_distributed_settings branch from 4663b86 to b89f89d Compare June 6, 2024 19:21
@mstv
Copy link
Member Author

mstv commented Jun 6, 2024

I have added the handler to the Deleted event amongst others, @astos-marcb.

@astos-marcb
Copy link
Contributor

@mstv preliminary tests with b89f89d CI artifact suggest both issues are fixed now.
Thanks for the quick fix, I'll try to use less strange repository setups in the future. 😄

Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have not run

@mstv mstv merged commit 7c2fe0a into gitextensions:master Jun 11, 2024
4 checks passed
@mstv mstv deleted the fix/11720_distributed_settings branch June 11, 2024 18:45
@RussKie RussKie added this to the vNext milestone Jun 23, 2024
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.

Distributed GitExtensions.settings not applied on change
4 participants