def purge(path, prune = true)
      object = object! path
      if object.is_a? Grit::Tree
        (object.blobs + object.trees).each do |blob|
          purge File.join(path, blob.basename), prune
        end
      else
        params = ['-f', '--index-filter',
                  "git rm --cached --ignore-unmatch #{path}"]
        params << '--prune-empty' if prune
        params << 'HEAD'
        @git.git.filter_branch({}, *params)
      end
    end
def purge(path, prune = true)
      object = object! path
      if object.is_a? Grit::Tree
        (object.blobs + object.trees).each do |blob|
          purge File.join(path, blob.basename), prune
        end
      else
        params = ['-f', '--index-filter',
                  "git rm --cached --ignore-unmatch #{path}"]
        params << '--prune-empty' if prune
        params << 'HEAD'
        @git.git.filter_branch({}, *params)
      end
    end
Purges a single file or the complete structure of a directory with the
 given path from the repository

 *WARNING*: This will cause a complete rewrite of the repository history
 and therefore deletes the data completely.

 @param [String] path The path of the file or directory to purge from the
        repository
 @param [Boolean] prune Remove empty commits in the Git history