mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
refactor: change the way to refresh repository's data.
* mark dirty instead of calling refresh method directly * force mark branches data dirty after remotes changed
This commit is contained in:
parent
3eb8a82005
commit
a89760c7a5
6 changed files with 33 additions and 17 deletions
|
@ -306,6 +306,14 @@ namespace SourceGit.ViewModels {
|
|||
if (_watcher != null) _watcher.SetEnabled(enabled);
|
||||
}
|
||||
|
||||
public void MarkBranchesDirtyManually() {
|
||||
if (_watcher != null) _watcher.MarkBranchDirtyManually();
|
||||
}
|
||||
|
||||
public void MarkWorkingCopyDirtyManually() {
|
||||
if (_watcher != null) _watcher.MarkWorkingCopyDirtyManually();
|
||||
}
|
||||
|
||||
public void NavigateToCommit(string sha) {
|
||||
if (_histories != null) {
|
||||
SelectedViewIndex = 0;
|
||||
|
@ -357,7 +365,7 @@ namespace SourceGit.ViewModels {
|
|||
} else if (File.Exists(otherMerge)) {
|
||||
mode = "merge";
|
||||
} else {
|
||||
await Task.Run(RefreshWorkingCopyChanges);
|
||||
MarkWorkingCopyDirtyManually();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -394,7 +402,7 @@ namespace SourceGit.ViewModels {
|
|||
} else if (File.Exists(Path.Combine(_gitDir, "MERGE_HEAD"))) {
|
||||
cmd.Args = "merge --abort";
|
||||
} else {
|
||||
await Task.Run(RefreshWorkingCopyChanges);
|
||||
MarkWorkingCopyDirtyManually();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -491,8 +499,6 @@ namespace SourceGit.ViewModels {
|
|||
HasUnsolvedConflict = hasUnsolvedConflict;
|
||||
OnPropertyChanged(nameof(WorkingCopyChangesCount));
|
||||
});
|
||||
|
||||
_watcher.MarkWorkingCopyRefreshed();
|
||||
}
|
||||
|
||||
public void RefreshStashes() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue