@@ -25,8 +25,10 @@ sealed class Repository : IEquatable<Repository>, IRepository
2525 private HashSet < CacheType > cacheInvalidationRequests = new HashSet < CacheType > ( ) ;
2626 private Dictionary < CacheType , Action < CacheUpdateEvent > > cacheUpdateEvents ;
2727 private ProgressReporter progressReporter = new ProgressReporter ( ) ;
28+ private NPath lastFileLog = NPath . Default ;
2829
2930 public event Action < CacheUpdateEvent > LogChanged ;
31+ public event Action < CacheUpdateEvent > FileLogChanged ;
3032 public event Action < CacheUpdateEvent > TrackingStatusChanged ;
3133 public event Action < CacheUpdateEvent > StatusEntriesChanged ;
3234 public event Action < CacheUpdateEvent > CurrentBranchChanged ;
@@ -63,6 +65,7 @@ public Repository(NPath localPath, ICacheContainer container)
6365 { CacheType . GitAheadBehind , c => TrackingStatusChanged ? . Invoke ( c ) } ,
6466 { CacheType . GitLocks , c => LocksChanged ? . Invoke ( c ) } ,
6567 { CacheType . GitLog , c => LogChanged ? . Invoke ( c ) } ,
68+ { CacheType . GitFileLog , c => FileLogChanged ? . Invoke ( c ) } ,
6669 { CacheType . GitStatus , c => StatusEntriesChanged ? . Invoke ( c ) } ,
6770 { CacheType . GitUser , cacheUpdateEvent => { } } ,
6871 { CacheType . RepositoryInfo , cacheUpdateEvent => {
@@ -91,6 +94,7 @@ public void Initialize(IRepositoryManager theRepositoryManager, ITaskManager the
9194 this . repositoryManager . GitStatusUpdated += RepositoryManagerOnGitStatusUpdated ;
9295 this . repositoryManager . GitAheadBehindStatusUpdated += RepositoryManagerOnGitAheadBehindStatusUpdated ;
9396 this . repositoryManager . GitLogUpdated += RepositoryManagerOnGitLogUpdated ;
97+ this . repositoryManager . GitFileLogUpdated += RepositoryManagerOnGitFileLogUpdated ;
9498 this . repositoryManager . GitLocksUpdated += RepositoryManagerOnGitLocksUpdated ;
9599 this . repositoryManager . LocalBranchesUpdated += RepositoryManagerOnLocalBranchesUpdated ;
96100 this . repositoryManager . RemoteBranchesUpdated += RepositoryManagerOnRemoteBranchesUpdated ;
@@ -143,6 +147,11 @@ public ITask SetupRemote(string remote, string remoteUrl)
143147 public ITask DeleteBranch ( string branch , bool force ) => repositoryManager . DeleteBranch ( branch , force ) ;
144148 public ITask CreateBranch ( string branch , string baseBranch ) => repositoryManager . CreateBranch ( branch , baseBranch ) ;
145149 public ITask SwitchBranch ( string branch ) => repositoryManager . SwitchBranch ( branch ) ;
150+ public ITask UpdateFileLog ( NPath path )
151+ {
152+ lastFileLog = path ;
153+ return repositoryManager . UpdateFileLog ( path ) ;
154+ }
146155
147156 public void CheckAndRaiseEventsIfCacheNewer ( CacheType cacheType , CacheUpdateEvent cacheUpdateEvent ) => cacheContainer . CheckAndRaiseEventsIfCacheNewer ( cacheType , cacheUpdateEvent ) ;
148157
@@ -215,6 +224,10 @@ private void CacheHasBeenInvalidated(CacheType cacheType)
215224 repositoryManager ? . UpdateGitLog ( ) . Catch ( ex => InvalidationFailed ( ex , cacheType ) ) . Start ( ) ;
216225 break ;
217226
227+ case CacheType . GitFileLog :
228+ repositoryManager ? . UpdateFileLog ( lastFileLog ) . Catch ( ex => InvalidationFailed ( ex , cacheType ) ) . Start ( ) ;
229+ break ;
230+
218231 case CacheType . GitAheadBehind :
219232 repositoryManager ? . UpdateGitAheadBehindStatus ( ) . Catch ( ex => InvalidationFailed ( ex , cacheType ) ) . Start ( ) ;
220233 break ;
@@ -295,6 +308,11 @@ private void RepositoryManagerOnGitLogUpdated(List<GitLogEntry> gitLogEntries)
295308 taskManager . RunInUI ( ( ) => cacheContainer . GitLogCache . Log = gitLogEntries ) ;
296309 }
297310
311+ private void RepositoryManagerOnGitFileLogUpdated ( GitFileLog gitFileLog )
312+ {
313+ taskManager . RunInUI ( ( ) => cacheContainer . GitFileLogCache . FileLog = gitFileLog ) ;
314+ }
315+
298316 private void RepositoryManagerOnGitLocksUpdated ( List < GitLock > gitLocks )
299317 {
300318 taskManager . RunInUI ( ( ) => cacheContainer . GitLocksCache . GitLocks = gitLocks ) ;
@@ -360,6 +378,7 @@ public void Dispose()
360378 public string CurrentBranchName => CurrentConfigBranch ? . Name ;
361379 public GitRemote ? CurrentRemote => cacheContainer . RepositoryInfoCache . CurrentGitRemote ;
362380 public List < GitLogEntry > CurrentLog => cacheContainer . GitLogCache . Log ;
381+ public GitFileLog CurrentFileLog => cacheContainer . GitFileLogCache . FileLog ;
363382 public List < GitLock > CurrentLocks => cacheContainer . GitLocksCache . GitLocks ;
364383 public string CurrentHead => cacheContainer . RepositoryInfoCache . CurrentHead ;
365384
0 commit comments