@@ -35,7 +35,7 @@ public interface IRepositoryManager : IDisposable
35
35
ITask UnlockFile ( string file , bool force ) ;
36
36
void UpdateGitLog ( ) ;
37
37
void UpdateGitStatus ( ) ;
38
- void UpdateGitAheadBehindStatus ( string gitRef , string otherRef ) ;
38
+ void UpdateGitAheadBehindStatus ( ) ;
39
39
void UpdateLocks ( ) ;
40
40
int WaitForEvents ( ) ;
41
41
@@ -284,17 +284,27 @@ public void UpdateGitStatus()
284
284
} ) . Start ( ) ;
285
285
}
286
286
287
- public void UpdateGitAheadBehindStatus ( string gitRef , string otherRef )
287
+ public void UpdateGitAheadBehindStatus ( )
288
288
{
289
- var task = GitClient . AheadBehindStatus ( gitRef , otherRef ) ;
290
- task = HookupHandlers ( task , true , false ) ;
291
- task . Then ( ( success , status ) =>
289
+ ConfigBranch ? configBranch ;
290
+ ConfigRemote ? configRemote ;
291
+ GetCurrentBranchAndRemote ( out configBranch , out configRemote ) ;
292
+
293
+ if ( configBranch . HasValue && configBranch . Value . Remote . HasValue )
292
294
{
293
- if ( success )
295
+ var name = configBranch . Value . Name ;
296
+ var trackingName = configBranch . Value . IsTracking ? configBranch . Value . Remote . Value . Name + "/" + name : "[None]" ;
297
+
298
+ var task = GitClient . AheadBehindStatus ( name , trackingName ) ;
299
+ task = HookupHandlers ( task , true , false ) ;
300
+ task . Then ( ( success , status ) =>
294
301
{
295
- GitAheadBehindStatusUpdated ? . Invoke ( status ) ;
296
- }
297
- } ) . Start ( ) ;
302
+ if ( success )
303
+ {
304
+ GitAheadBehindStatusUpdated ? . Invoke ( status ) ;
305
+ }
306
+ } ) . Start ( ) ;
307
+ }
298
308
}
299
309
300
310
public void UpdateLocks ( )
@@ -437,6 +447,7 @@ private void WatcherOnRepositoryCommitted()
437
447
{
438
448
Logger . Trace ( "WatcherOnRepositoryCommitted" ) ;
439
449
UpdateGitLog ( ) ;
450
+ UpdateGitAheadBehindStatus ( ) ;
440
451
}
441
452
442
453
private void WatcherOnRepositoryChanged ( )
@@ -536,17 +547,7 @@ private void UpdateRemoteBranches()
536
547
Logger . Trace ( "OnRemoteBranchListUpdated {0} remotes" , remotes . Count ) ;
537
548
RemoteBranchesUpdated ? . Invoke ( remotes , remoteBranches ) ;
538
549
539
- ConfigBranch ? configBranch ;
540
- ConfigRemote ? configRemote ;
541
- GetCurrentBranchAndRemote ( out configBranch , out configRemote ) ;
542
-
543
- if ( configBranch . HasValue && configBranch . Value . Remote . HasValue )
544
- {
545
- var name = configBranch . Value . Name ;
546
- var trackingName = configBranch . Value . IsTracking ? configBranch . Value . Remote . Value . Name + "/" + name : "[None]" ;
547
-
548
- UpdateGitAheadBehindStatus ( name , trackingName ) ;
549
- }
550
+ UpdateGitAheadBehindStatus ( ) ;
550
551
}
551
552
552
553
private bool disposed ;
0 commit comments