@@ -150,25 +150,40 @@ public IObservable<bool> IsWorkingDirectoryClean(ILocalRepositoryModel repositor
150150 using ( var repo = gitService . GetRepository ( repository . LocalPath ) )
151151 {
152152 var statusOptions = new StatusOptions { ExcludeSubmodules = true } ;
153- var isClean = ! IsFilthy ( repo . RetrieveStatus ( statusOptions ) ) ;
153+ var status = repo . RetrieveStatus ( statusOptions ) ;
154+ var isClean = ! IsCheckoutBlockingDirty ( status ) ;
154155 return Observable . Return ( isClean ) ;
155156 }
156157 }
157158
158- static bool IsFilthy ( RepositoryStatus status )
159+ static bool IsCheckoutBlockingDirty ( RepositoryStatus status )
159160 {
160161 if ( status . IsDirty )
161162 {
162- // This is similar to IsDirty, but also allows NewInWorkdir files
163- return status . Any ( entry =>
164- entry . State != FileStatus . Ignored &&
165- entry . State != FileStatus . Unaltered &&
166- entry . State != FileStatus . NewInWorkdir ) ;
163+ return status . Any ( entry => IsCheckoutBlockingChange ( entry ) ) ;
167164 }
168165
169166 return false ;
170167 }
171168
169+ // This is similar to IsDirty, but also allows NewInWorkdir and DeletedFromWorkdir files
170+ static bool IsCheckoutBlockingChange ( StatusEntry entry )
171+ {
172+ switch ( entry . State )
173+ {
174+ case FileStatus . Ignored :
175+ return false ;
176+ case FileStatus . Unaltered :
177+ return false ;
178+ case FileStatus . NewInWorkdir :
179+ return false ;
180+ case FileStatus . DeletedFromWorkdir :
181+ return false ;
182+ default :
183+ return true ;
184+ }
185+ }
186+
172187 public IObservable < Unit > Pull ( ILocalRepositoryModel repository )
173188 {
174189 return Observable . Defer ( async ( ) =>
0 commit comments