@@ -8,23 +8,20 @@ namespace GitHub.Unity
8
8
{
9
9
public interface IRepositoryManager : IDisposable
10
10
{
11
- event Action < bool > OnIsBusyChanged ;
12
- event Action < GitStatus > OnStatusUpdated ;
13
- event Action < IList < GitLock > > OnLocksUpdated ;
14
- event Action < Dictionary < string , ConfigBranch > > OnLocalBranchListUpdated ;
15
- event Action < Dictionary < string , ConfigRemote > , Dictionary < string , Dictionary < string , ConfigBranch > > > OnRemoteBranchListUpdated ;
16
11
event Action < ConfigBranch ? > OnCurrentBranchUpdated ;
17
12
event Action < ConfigRemote ? > OnCurrentRemoteUpdated ;
18
- event Action < string > OnLocalBranchUpdated ;
13
+ event Action < IUser > OnGitUserLoaded ;
14
+ event Action < bool > OnIsBusyChanged ;
19
15
event Action < string > OnLocalBranchAdded ;
16
+ event Action < Dictionary < string , ConfigBranch > > OnLocalBranchListUpdated ;
20
17
event Action < string > OnLocalBranchRemoved ;
18
+ event Action < string > OnLocalBranchUpdated ;
19
+ event Action < IList < GitLock > > OnLocksUpdated ;
21
20
event Action < string , string > OnRemoteBranchAdded ;
21
+ event Action < Dictionary < string , ConfigRemote > , Dictionary < string , Dictionary < string , ConfigBranch > > > OnRemoteBranchListUpdated ;
22
22
event Action < string , string > OnRemoteBranchRemoved ;
23
- event Action < IUser > OnGitUserLoaded ;
23
+ event Action < GitStatus > OnStatusUpdated ;
24
24
25
- IGitConfig Config { get ; }
26
- IGitClient GitClient { get ; }
27
- bool IsBusy { get ; }
28
25
void Initialize ( ) ;
29
26
void Start ( ) ;
30
27
void Stop ( ) ;
@@ -46,6 +43,10 @@ public interface IRepositoryManager : IDisposable
46
43
ITask LockFile ( string file ) ;
47
44
ITask UnlockFile ( string file , bool force ) ;
48
45
int WaitForEvents ( ) ;
46
+
47
+ IGitConfig Config { get ; }
48
+ IGitClient GitClient { get ; }
49
+ bool IsBusy { get ; }
49
50
}
50
51
51
52
interface IRepositoryPathConfiguration
@@ -103,36 +104,20 @@ class RepositoryManager : IRepositoryManager
103
104
private readonly IRepositoryWatcher watcher ;
104
105
105
106
private bool isBusy ;
106
- private Action repositoryUpdateCallback ;
107
-
108
- // internal busy flag signal
109
- public event Action < bool > OnIsBusyChanged ;
110
107
111
- public event Action < Dictionary < string , ConfigBranch > > OnLocalBranchListUpdated ;
112
- public event Action < Dictionary < string , ConfigRemote > , Dictionary < string , Dictionary < string , ConfigBranch > > > OnRemoteBranchListUpdated ;
113
- public event Action < IList < GitLock > > OnLocksUpdated ;
114
- public event Action < GitStatus > OnStatusUpdated ;
115
108
public event Action < ConfigBranch ? > OnCurrentBranchUpdated ;
116
109
public event Action < ConfigRemote ? > OnCurrentRemoteUpdated ;
117
- public event Action < string > OnLocalBranchUpdated ;
110
+ public event Action < IUser > OnGitUserLoaded ;
111
+ public event Action < bool > OnIsBusyChanged ;
118
112
public event Action < string > OnLocalBranchAdded ;
113
+ public event Action < Dictionary < string , ConfigBranch > > OnLocalBranchListUpdated ;
119
114
public event Action < string > OnLocalBranchRemoved ;
115
+ public event Action < string > OnLocalBranchUpdated ;
116
+ public event Action < IList < GitLock > > OnLocksUpdated ;
120
117
public event Action < string , string > OnRemoteBranchAdded ;
118
+ public event Action < Dictionary < string , ConfigRemote > , Dictionary < string , Dictionary < string , ConfigBranch > > > OnRemoteBranchListUpdated ;
121
119
public event Action < string , string > OnRemoteBranchRemoved ;
122
- public event Action < IUser > OnGitUserLoaded ;
123
-
124
- public static RepositoryManager CreateInstance ( IPlatform platform , ITaskManager taskManager , IUsageTracker usageTracker ,
125
- IGitClient gitClient , NPath repositoryRoot )
126
- {
127
- var repositoryPathConfiguration = new RepositoryPathConfiguration ( repositoryRoot ) ;
128
- string filePath = repositoryPathConfiguration . DotGitConfig ;
129
- var gitConfig = new GitConfig ( filePath ) ;
130
-
131
- var repositoryWatcher = new RepositoryWatcher ( platform , repositoryPathConfiguration , taskManager . Token ) ;
132
-
133
- return new RepositoryManager ( platform , taskManager , usageTracker , gitConfig , repositoryWatcher ,
134
- gitClient , repositoryPathConfiguration , taskManager . Token ) ;
135
- }
120
+ public event Action < GitStatus > OnStatusUpdated ;
136
121
137
122
public RepositoryManager ( IPlatform platform , ITaskManager taskManager , IUsageTracker usageTracker , IGitConfig gitConfig ,
138
123
IRepositoryWatcher repositoryWatcher , IGitClient gitClient ,
@@ -150,6 +135,19 @@ public RepositoryManager(IPlatform platform, ITaskManager taskManager, IUsageTra
150
135
SetupWatcher ( ) ;
151
136
}
152
137
138
+ public static RepositoryManager CreateInstance ( IPlatform platform , ITaskManager taskManager , IUsageTracker usageTracker ,
139
+ IGitClient gitClient , NPath repositoryRoot )
140
+ {
141
+ var repositoryPathConfiguration = new RepositoryPathConfiguration ( repositoryRoot ) ;
142
+ string filePath = repositoryPathConfiguration . DotGitConfig ;
143
+ var gitConfig = new GitConfig ( filePath ) ;
144
+
145
+ var repositoryWatcher = new RepositoryWatcher ( platform , repositoryPathConfiguration , taskManager . Token ) ;
146
+
147
+ return new RepositoryManager ( platform , taskManager , usageTracker , gitConfig , repositoryWatcher ,
148
+ gitClient , repositoryPathConfiguration , taskManager . Token ) ;
149
+ }
150
+
153
151
public void Initialize ( )
154
152
{
155
153
Logger . Trace ( "Initialize" ) ;
0 commit comments