class Git::Lib

def diff_index(treeish)

compares the index and the repository
def diff_index(treeish)
  hsh = {}
  command_lines('diff-index', treeish).each do |line|
    (info, file) = line.split("\t")
    (mode_src, mode_dest, sha_src, sha_dest, type) = info.split
    hsh[file] = {:path => file, :mode_repo => mode_src.to_s[1, 7], :mode_index => mode_dest, 
                  :sha_repo => sha_src, :sha_index => sha_dest, :type => type}
  end
  hsh
end