Don't destroy repo in ::removePath if it is still needed

This commit is contained in:
Max Brunsfeld
2015-02-19 10:28:54 -08:00
parent d4298bf077
commit cf60855245
2 changed files with 7 additions and 1 deletions

View File

@@ -225,7 +225,7 @@ class Project extends Model
[removedDirectory] = @rootDirectories.splice(indexToRemove, 1)
[removedRepository] = @repositories.splice(indexToRemove, 1)
removedDirectory.off()
removedRepository?.destroy()
removedRepository?.destroy() unless removedRepository in @repositories
@emit "path-changed"
@emitter.emit "did-change-paths", @getPaths()
true