@@ -100,7 +100,6 @@ class RepositoryManager : IRepositoryManager
100100 private readonly IGitConfig config ;
101101 private readonly IGitClient gitClient ;
102102 private readonly IRepositoryPathConfiguration repositoryPaths ;
103- private readonly IFileSystem fileSystem ;
104103 private readonly CancellationToken token ;
105104 private readonly IRepositoryWatcher watcher ;
106105
@@ -118,13 +117,12 @@ class RepositoryManager : IRepositoryManager
118117 public event Action < CacheType > DataNeedsRefreshing ;
119118
120119 public RepositoryManager ( IGitConfig gitConfig ,
121- IRepositoryWatcher repositoryWatcher , IGitClient gitClient ,
122- IFileSystem fileSystem ,
120+ IRepositoryWatcher repositoryWatcher ,
121+ IGitClient gitClient ,
123122 CancellationToken token ,
124123 IRepositoryPathConfiguration repositoryPaths )
125124 {
126125 this . repositoryPaths = repositoryPaths ;
127- this . fileSystem = fileSystem ;
128126 this . token = token ;
129127 this . gitClient = gitClient ;
130128 this . watcher = repositoryWatcher ;
@@ -140,7 +138,7 @@ public RepositoryManager(IGitConfig gitConfig,
140138 }
141139
142140 public static RepositoryManager CreateInstance ( IPlatform platform , ITaskManager taskManager , IGitClient gitClient ,
143- IFileSystem fileSystem , NPath repositoryRoot )
141+ NPath repositoryRoot )
144142 {
145143 var repositoryPathConfiguration = new RepositoryPathConfiguration ( repositoryRoot ) ;
146144 string filePath = repositoryPathConfiguration . DotGitConfig ;
@@ -149,7 +147,7 @@ public static RepositoryManager CreateInstance(IPlatform platform, ITaskManager
149147 var repositoryWatcher = new RepositoryWatcher ( platform , repositoryPathConfiguration , taskManager . Token ) ;
150148
151149 return new RepositoryManager ( gitConfig , repositoryWatcher ,
152- gitClient , fileSystem ,
150+ gitClient ,
153151 taskManager . Token , repositoryPathConfiguration ) ;
154152 }
155153
@@ -302,14 +300,14 @@ public ITask DiscardChanges(GitStatusEntry[] gitStatusEntries)
302300 ActionTask < GitStatusEntry [ ] > task = null ;
303301 task = new ActionTask < GitStatusEntry [ ] > ( token , ( _ , entries ) =>
304302 {
305- var itemsToDelete = new List < string > ( ) ;
303+ var itemsToDelete = new List < NPath > ( ) ;
306304 var itemsToRevert = new List < string > ( ) ;
307305
308306 foreach ( var gitStatusEntry in gitStatusEntries )
309307 {
310308 if ( gitStatusEntry . status == GitFileStatus . Added || gitStatusEntry . status == GitFileStatus . Untracked )
311309 {
312- itemsToDelete . Add ( gitStatusEntry . path ) ;
310+ itemsToDelete . Add ( gitStatusEntry . path . ToNPath ( ) . MakeAbsolute ( ) ) ;
313311 }
314312 else
315313 {
@@ -321,7 +319,7 @@ public ITask DiscardChanges(GitStatusEntry[] gitStatusEntries)
321319 {
322320 foreach ( var itemToDelete in itemsToDelete )
323321 {
324- fileSystem . FileDelete ( itemToDelete ) ;
322+ itemToDelete . DeleteIfExists ( ) ;
325323 }
326324 }
327325
0 commit comments