anchor.diff:  }
   
   class TreeDiffResult {
  -  List<DiffEntry> diffEntries = [];
  +  Map<String, DiffEntry> entries = {};
   
     List<DiffEntry> getAddedEntries() => _getEntriesForType(DiffEntryType.ADDED);
     List<DiffEntry> getRemovedEntries() => _getEntriesForType(DiffEntryType.REMOVED);
     List<DiffEntry> getModifiedEntries() => _getEntriesForType(DiffEntryType.MODIFIED);
   
     List<DiffEntry> _getEntriesForType(String type)
  -   => diffEntries.where((diffEntry) => diffEntry.type == type).toList();
  -  TreeDiffResult addEntry(DiffEntry diffEntry) {
  -    diffEntries.add(diffEntry);
  -    return this;
  +      => entries.values.where((entry) => entry.type == type).toList();
  +
  +  void addEntry(DiffEntry diffEntry) {
  +    entries[diffEntry.path] = diffEntry;
  +  }
  +
  +  void removeEntry(DiffEntry diffEntry) {
  +     entries.remove(diffEntry.path);
  +  }
  +
  +  void addAll(List<DiffEntry> diffEntries) {
  +    diffEntries.forEach((diffEntry) {
  +      entries[diffEntry.path] = diffEntry;
  +    });
  +  }
  +
  +  void removeAll(List<DiffEntry> diffEntries) {
  +    diffEntries.forEach((diffEntry) {
  +      entries.remove(diffEntry.path);
  +    });
  +  }
  +
  +  void clear() {
  +    entries.clear();
     }
   }
   
  
positive.code: 
  library git.commands.diff;
  
  import '../object.dart';
  
  class DiffEntryType {
    static const String ADDED = "ADDED";
  
negative.code:   // String representation of the diff between the two versions of file.
    String diff;
    String type;
    DiffEntry(this.oldEntry, this.newEntry, this.type,  [String path]) {
      if (path == null) {
        path = oldEntry == null ? newEntry.name : oldEntry.name;
      } else {
  