@@ -100,7 +100,6 @@ class RepositoryManager : IRepositoryManager
100
100
private readonly IGitConfig config ;
101
101
private readonly IGitClient gitClient ;
102
102
private readonly IRepositoryPathConfiguration repositoryPaths ;
103
- private readonly IFileSystem fileSystem ;
104
103
private readonly CancellationToken token ;
105
104
private readonly IRepositoryWatcher watcher ;
106
105
@@ -118,13 +117,12 @@ class RepositoryManager : IRepositoryManager
118
117
public event Action < CacheType > DataNeedsRefreshing ;
119
118
120
119
public RepositoryManager ( IGitConfig gitConfig ,
121
- IRepositoryWatcher repositoryWatcher , IGitClient gitClient ,
122
- IFileSystem fileSystem ,
120
+ IRepositoryWatcher repositoryWatcher ,
121
+ IGitClient gitClient ,
123
122
CancellationToken token ,
124
123
IRepositoryPathConfiguration repositoryPaths )
125
124
{
126
125
this . repositoryPaths = repositoryPaths ;
127
- this . fileSystem = fileSystem ;
128
126
this . token = token ;
129
127
this . gitClient = gitClient ;
130
128
this . watcher = repositoryWatcher ;
@@ -140,7 +138,7 @@ public RepositoryManager(IGitConfig gitConfig,
140
138
}
141
139
142
140
public static RepositoryManager CreateInstance ( IPlatform platform , ITaskManager taskManager , IGitClient gitClient ,
143
- IFileSystem fileSystem , NPath repositoryRoot )
141
+ NPath repositoryRoot )
144
142
{
145
143
var repositoryPathConfiguration = new RepositoryPathConfiguration ( repositoryRoot ) ;
146
144
string filePath = repositoryPathConfiguration . DotGitConfig ;
@@ -149,7 +147,7 @@ public static RepositoryManager CreateInstance(IPlatform platform, ITaskManager
149
147
var repositoryWatcher = new RepositoryWatcher ( platform , repositoryPathConfiguration , taskManager . Token ) ;
150
148
151
149
return new RepositoryManager ( gitConfig , repositoryWatcher ,
152
- gitClient , fileSystem ,
150
+ gitClient ,
153
151
taskManager . Token , repositoryPathConfiguration ) ;
154
152
}
155
153
@@ -302,14 +300,14 @@ public ITask DiscardChanges(GitStatusEntry[] gitStatusEntries)
302
300
ActionTask < GitStatusEntry [ ] > task = null ;
303
301
task = new ActionTask < GitStatusEntry [ ] > ( token , ( _ , entries ) =>
304
302
{
305
- var itemsToDelete = new List < string > ( ) ;
303
+ var itemsToDelete = new List < NPath > ( ) ;
306
304
var itemsToRevert = new List < string > ( ) ;
307
305
308
306
foreach ( var gitStatusEntry in gitStatusEntries )
309
307
{
310
308
if ( gitStatusEntry . status == GitFileStatus . Added || gitStatusEntry . status == GitFileStatus . Untracked )
311
309
{
312
- itemsToDelete . Add ( gitStatusEntry . path ) ;
310
+ itemsToDelete . Add ( gitStatusEntry . path . ToNPath ( ) . MakeAbsolute ( ) ) ;
313
311
}
314
312
else
315
313
{
@@ -321,7 +319,7 @@ public ITask DiscardChanges(GitStatusEntry[] gitStatusEntries)
321
319
{
322
320
foreach ( var itemToDelete in itemsToDelete )
323
321
{
324
- fileSystem . FileDelete ( itemToDelete ) ;
322
+ itemToDelete . DeleteIfExists ( ) ;
325
323
}
326
324
}
327
325
0 commit comments