Skip to content

Commit 83be4bd

Browse files
committed
enhance: refresh submodules manually after update/de-init submodule
Signed-off-by: leo <longshuang@msn.cn>
1 parent a570951 commit 83be4bd

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

src/Models/Watcher.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ public void MarkStashUpdated()
118118
Interlocked.Exchange(ref _updateStashes, 0);
119119
}
120120

121+
public void MarkSubmodulesUpdated()
122+
{
123+
Interlocked.Exchange(ref _updateSubmodules, 0);
124+
}
125+
121126
public void Dispose()
122127
{
123128
foreach (var watcher in _watchers)

src/ViewModels/DeinitSubmodule.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public override async Task<bool> Sure()
3636
.DeinitAsync(Submodule, false);
3737

3838
log.Complete();
39+
_repo.MarkSubmodulesDirtyManually();
3940
return succ;
4041
}
4142

src/ViewModels/Repository.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,12 @@ public void MarkStashesDirtyManually()
877877
RefreshStashes();
878878
}
879879

880+
public void MarkSubmodulesDirtyManually()
881+
{
882+
_watcher?.MarkSubmodulesUpdated();
883+
RefreshSubmodules();
884+
}
885+
880886
public void MarkFetched()
881887
{
882888
_lastFetchTime = DateTime.Now;

src/ViewModels/UpdateSubmodules.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public override async Task<bool> Sure()
9696
.UpdateAsync(targets, EnableInit, EnableRecursive, EnableRemote);
9797

9898
log.Complete();
99+
_repo.MarkSubmodulesDirtyManually();
99100
return true;
100101
}
101102

0 commit comments

Comments
 (0)