@@ -57,25 +57,21 @@ private set
57
57
public void MonitorRepository ( string repositoryWorkingPath )
58
58
{
59
59
if ( repositoryWorkingPath == null ) return ;
60
-
61
- string gitPath = ModelExtensions . GetGitRepositoryPath ( repositoryWorkingPath ) ;
62
- if ( ! Directory . Exists ( gitPath ) )
63
- {
64
- MonitorForRepositoryCreation ( repositoryWorkingPath ) ;
65
- return ;
66
- }
67
60
68
- RepositoryPath = repositoryWorkingPath ;
61
+ string gitPath = ModelExtensions . GetGitRepositoryPath ( repositoryWorkingPath ) ;
69
62
70
63
_graphBuilder = _graphBuilderThunk ( gitPath ) ;
71
64
RepositoryPath = Directory . GetParent ( gitPath ) . FullName ;
72
- Graph = _graphBuilder . Graph ( ) ;
65
+ var graph = _graphBuilder . Graph ( ) ;
73
66
74
- if ( _graph . VertexCount > 1 )
75
- _graph . LayoutAlgorithmType = "EfficientSugiyama" ;
76
- Graph = Graph ;
67
+ if ( graph . VertexCount > 1 )
68
+ graph . LayoutAlgorithmType = "EfficientSugiyama" ;
69
+ Graph = graph ;
77
70
78
- MonitorForRepositoryChanges ( gitPath ) ;
71
+ if ( ! Directory . Exists ( gitPath ) )
72
+ MonitorForRepositoryCreation ( RepositoryPath ) ;
73
+ else
74
+ MonitorForRepositoryChanges ( gitPath ) ;
79
75
}
80
76
81
77
private void MonitorForRepositoryCreation ( string repositoryWorkingPath )
@@ -92,7 +88,11 @@ private void MonitorForRepositoryChanges(string gitRepositoryPath)
92
88
93
89
public void Refresh ( )
94
90
{
95
- Graph = _graphBuilder . Graph ( ) ;
91
+ string gitPath = ModelExtensions . GetGitRepositoryPath ( RepositoryPath ) ;
92
+ if ( ! Directory . Exists ( gitPath ) )
93
+ MonitorRepository ( RepositoryPath ) ;
94
+ else
95
+ Graph = _graphBuilder . Graph ( ) ;
96
96
}
97
97
98
98
public bool ToggleSettings ( )
0 commit comments