@@ -107,18 +107,22 @@ private void Tick(object sender)
107107 {
108108 _updateBranch = 0 ;
109109 _updateWC = 0 ;
110- _updateSubmodules = 0 ;
111110
112111 if ( _updateTags > 0 )
113112 {
114113 _updateTags = 0 ;
115114 Task . Run ( _repo . RefreshTags ) ;
116115 }
117116
117+ if ( _updateSubmodules > 0 || _repo . MayHaveSubmodules ( ) )
118+ {
119+ _updateSubmodules = 0 ;
120+ Task . Run ( _repo . RefreshSubmodules ) ;
121+ }
122+
118123 Task . Run ( _repo . RefreshBranches ) ;
119124 Task . Run ( _repo . RefreshCommits ) ;
120125 Task . Run ( _repo . RefreshWorkingCopyChanges ) ;
121- Task . Run ( _repo . RefreshSubmodules ) ;
122126 Task . Run ( _repo . RefreshWorktrees ) ;
123127 }
124128
@@ -150,12 +154,13 @@ private void Tick(object sender)
150154
151155 private void OnRepositoryChanged ( object o , FileSystemEventArgs e )
152156 {
153- if ( string . IsNullOrEmpty ( e . Name ) || e . Name . EndsWith ( ".lock" , StringComparison . Ordinal ) )
157+ if ( string . IsNullOrEmpty ( e . Name ) )
154158 return ;
155159
156160 var name = e . Name . Replace ( "\\ " , "/" ) ;
157-
158- if ( name . Contains ( "fsmonitor--daemon/" , StringComparison . Ordinal ) )
161+ if ( name . Contains ( "fsmonitor--daemon/" , StringComparison . Ordinal ) ||
162+ name . EndsWith ( ".lock" , StringComparison . Ordinal ) ||
163+ name . StartsWith ( "lfs/" , StringComparison . Ordinal ) )
159164 return ;
160165
161166 if ( name . StartsWith ( "modules" , StringComparison . Ordinal ) )
@@ -170,8 +175,8 @@ private void OnRepositoryChanged(object o, FileSystemEventArgs e)
170175 else if ( name . Equals ( "MERGE_HEAD" , StringComparison . Ordinal ) ||
171176 name . Equals ( "AUTO_MERGE" , StringComparison . Ordinal ) )
172177 {
173- _updateSubmodules = DateTime . Now . AddSeconds ( 1 ) . ToFileTime ( ) ;
174- _updateWC = DateTime . Now . AddSeconds ( 1 ) . ToFileTime ( ) ;
178+ if ( _repo . MayHaveSubmodules ( ) )
179+ _updateSubmodules = DateTime . Now . AddSeconds ( 1 ) . ToFileTime ( ) ;
175180 }
176181 else if ( name . StartsWith ( "refs/tags" , StringComparison . Ordinal ) )
177182 {
@@ -201,13 +206,12 @@ private void OnWorkingCopyChanged(object o, FileSystemEventArgs e)
201206 return ;
202207
203208 var name = e . Name . Replace ( "\\ " , "/" ) ;
204-
205209 if ( name . Equals ( ".git" , StringComparison . Ordinal ) ||
206210 name . StartsWith ( ".git/" , StringComparison . Ordinal ) ||
207211 name . EndsWith ( "/.git" , StringComparison . Ordinal ) )
208212 return ;
209213
210- if ( name . StartsWith ( ".vs/" , StringComparison . Ordinal ) && name . EndsWith ( "/.suo" , StringComparison . Ordinal ) )
214+ if ( name . StartsWith ( ".vs/" , StringComparison . Ordinal ) )
211215 return ;
212216
213217 if ( name . Equals ( ".gitmodules" , StringComparison . Ordinal ) )
0 commit comments