def add(path, data)
      path = path.split('/')
      filename = path.pop

      current = self.tree

      path.each do |dir|
        current[dir] ||= {}
        node = current[dir]
        current = node
      end

      current[filename] = data
    end
def add(path, data)
      path = path.split('/')
      filename = path.pop

      current = self.tree

      path.each do |dir|
        current[dir] ||= {}
        node = current[dir]
        current = node
      end

      current[filename] = data
    end
Initialize a new Index object.

 repo - The Grit::Repo to which the index belongs.

 Returns the newly initialized Grit::Index.
 Public: Add a file to the index.

 path - The String file path including filename (no slash prefix).
 data - The String binary contents of the file.

 Returns nothing.