def get_patch(options={}, applies_sha=nil)
      options, applies_sha = {}, options if !options.is_a?(Hash)
      options = options.dup
      options[:env] &&= options[:env].dup

      git_index = create_tempfile('index', true)
      (options[:env] ||= {}).merge!('GIT_INDEX_FILE' => git_index)

      native(:diff, options, "#{applies_sha}^", applies_sha)
    end
def get_patch(options={}, applies_sha=nil)
      options, applies_sha = {}, options if !options.is_a?(Hash)
      options = options.dup
      options[:env] &&= options[:env].dup

      git_index = create_tempfile('index', true)
      (options[:env] ||= {}).merge!('GIT_INDEX_FILE' => git_index)

      native(:diff, options, "#{applies_sha}^", applies_sha)
    end
Gets a patch for a given SHA using `git diff`.

 options     - grit command options hash
 applies_sha - String SHA to get the patch from, using this command:
               `git diff #{applies_sha}^ #{applies_sha}`

 Returns the String patch from `git diff`.