File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ private void Tick(object sender)
122
122
var now = DateTime . Now . ToFileTime ( ) ;
123
123
var refreshCommits = false ;
124
124
var refreshSubmodules = false ;
125
+ var refreshWC = false ;
125
126
126
127
var oldUpdateBranch = Interlocked . Exchange ( ref _updateBranch , - 1 ) ;
127
128
if ( oldUpdateBranch > 0 )
@@ -130,6 +131,7 @@ private void Tick(object sender)
130
131
{
131
132
refreshCommits = true ;
132
133
refreshSubmodules = _repo . MayHaveSubmodules ( ) ;
134
+ refreshWC = true ;
133
135
134
136
_repo . RefreshBranches ( ) ;
135
137
_repo . RefreshWorktrees ( ) ;
@@ -140,13 +142,21 @@ private void Tick(object sender)
140
142
}
141
143
}
142
144
143
- var oldUpdateWC = Interlocked . Exchange ( ref _updateWC , - 1 ) ;
144
- if ( oldUpdateWC > 0 )
145
+ if ( refreshWC )
145
146
{
146
- if ( now > oldUpdateWC )
147
- _repo . RefreshWorkingCopyChanges ( ) ;
148
- else
149
- Interlocked . CompareExchange ( ref _updateWC , oldUpdateWC , - 1 ) ;
147
+ Interlocked . Exchange ( ref _updateWC , - 1 ) ;
148
+ _repo . RefreshWorkingCopyChanges ( ) ;
149
+ }
150
+ else
151
+ {
152
+ var oldUpdateWC = Interlocked . Exchange ( ref _updateWC , - 1 ) ;
153
+ if ( oldUpdateWC > 0 )
154
+ {
155
+ if ( now > oldUpdateWC )
156
+ _repo . RefreshWorkingCopyChanges ( ) ;
157
+ else
158
+ Interlocked . CompareExchange ( ref _updateWC , oldUpdateWC , - 1 ) ;
159
+ }
150
160
}
151
161
152
162
if ( refreshSubmodules )
You can’t perform that action at this time.
0 commit comments