code_review: PR #1043

`FileModeChange` should not be changed out of UIThread

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-03 14:25:49 +08:00
parent 72c7f24e2f
commit 598bba5210
No known key found for this signature in database

View file

@ -60,6 +60,7 @@ namespace SourceGit.ViewModels
{ {
_isTextDiff = previous._isTextDiff; _isTextDiff = previous._isTextDiff;
_content = previous._content; _content = previous._content;
_fileModeChange = previous._fileModeChange;
_unifiedLines = previous._unifiedLines; _unifiedLines = previous._unifiedLines;
_ignoreWhitespace = previous._ignoreWhitespace; _ignoreWhitespace = previous._ignoreWhitespace;
_info = previous._info; _info = previous._info;
@ -116,10 +117,7 @@ namespace SourceGit.ViewModels
var latest = new Commands.Diff(_repo, _option, numLines, _ignoreWhitespace).Result(); var latest = new Commands.Diff(_repo, _option, numLines, _ignoreWhitespace).Result();
var info = new Info(_option, numLines, _ignoreWhitespace, latest); var info = new Info(_option, numLines, _ignoreWhitespace, latest);
if (_info != null && info.IsSame(_info)) if (_info != null && info.IsSame(_info))
{
FileModeChange = latest.FileModeChange;
return; return;
}
_info = info; _info = info;