def file_difference(file_path, commit)
      if staging_area.file? file_path
        file_lines = staging_area.fetch(file_path).lines
        file_lines.last << "\n" unless file_lines.last.nil? or file_lines.last.end_with? "\n"
      else
        file_lines = []
      end

      tree   = get_object commit.tree

      blob_name_and_id = tree.all_files(object_store).find { |file, _| file_path == file }

      if blob_name_and_id.nil?
        blob_lines = []
      else
        blob       = get_object blob_name_and_id.last
        blob_lines = blob.content.lines
        blob_lines.last << "\n" unless blob_lines.last.nil? or blob_lines.last.end_with? "\n"
      end

      Diff.from_sequences blob_lines, file_lines
    end
def file_difference(file_path, commit)
      if staging_area.file? file_path
        file_lines = staging_area.fetch(file_path).lines
        file_lines.last << "\n" unless file_lines.last.nil? or file_lines.last.end_with? "\n"
      else
        file_lines = []
      end

      tree   = get_object commit.tree

      blob_name_and_id = tree.all_files(object_store).find { |file, _| file_path == file }

      if blob_name_and_id.nil?
        blob_lines = []
      else
        blob       = get_object blob_name_and_id.last
        blob_lines = blob.content.lines
        blob_lines.last << "\n" unless blob_lines.last.nil? or blob_lines.last.end_with? "\n"
      end

      Diff.from_sequences blob_lines, file_lines
    end
Return a list of changes between a file in the staging area
 and a specific commit.

 This method is just a tiny wrapper around VCSToolkit::Diff.from_sequences
 which loads the two files and splits them by lines beforehand.
 It also ensures that both files have \n at the end (otherwise the last
 two lines of the diff may be merged).