File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -536,14 +536,17 @@ public void Close()
536536 }
537537 }
538538
539- try
540- {
541- using var stream = File . Create ( Path . Combine ( GitDir , "sourcegit.filters" ) ) ;
542- JsonSerializer . Serialize ( stream , _historyFilterCollection , JsonCodeGen . Default . HistoryFilterCollection ) ;
543- }
544- catch
539+ if ( Directory . Exists ( GitDir ) )
545540 {
546- // Ignore
541+ try
542+ {
543+ using var stream = File . Create ( Path . Combine ( GitDir , "sourcegit.filters" ) ) ;
544+ JsonSerializer . Serialize ( stream , _historyFilterCollection , JsonCodeGen . Default . HistoryFilterCollection ) ;
545+ }
546+ catch
547+ {
548+ // Ignore
549+ }
547550 }
548551
549552 if ( _cancellationRefreshBranches is { IsCancellationRequested : false } )
@@ -561,6 +564,7 @@ public void Close()
561564 _autoFetchTimer = null ;
562565
563566 _settings = null ;
567+ _historyFilterCollection = null ;
564568 _historyFilterMode = Models . FilterMode . None ;
565569
566570 _watcher ? . Dispose ( ) ;
You can’t perform that action at this time.
0 commit comments