vendor/bundle/ruby/1.8/gems/grit-2.4.1/lib/grit/git.rb
def apply_patch(head_sha, patch)
      git_index = create_tempfile('index', true)

      options = {:env => {'GIT_INDEX_FILE' => git_index}, :raise => true}
      begin
        native(:read_tree, options.dup, head_sha)
        native(:apply, options.merge(:cached => true, :input => patch))
      rescue CommandFailed
        return false
      end
      native(:write_tree, :env => options[:env]).to_s.chomp!
    end
# Applies the given patch against the given SHA of the current repo.
#
# head_sha - String SHA or ref to apply the patch to.
# patch    - The String patch to apply.  Get this from #get_patch.
#
# Returns the String Tree SHA on a successful patch application, or false.
Applies the given patch against the given SHA of the current repo.
head_sha - String SHA or ref to apply the patch to.
patch    - The String patch to apply.  Get this from #get_patch.

Returns the String Tree SHA on a successful patch application, or false.
Applies the given patch against the given SHA of the current repo . head_sha - String SHA or ref to apply the patch to . patch - The String patch to apply . Get this from #get_patch . Returns the String Tree SHA on a successful patch application or false .
def apply_patch(head_sha, patch)
      git_index = create_tempfile('index', true)
      options = {:env => {'GIT_INDEX_FILE' => git_index}, :raise => true}
      begin
        native(:read_tree, options.dup, head_sha)
        native(:apply, options.merge(:cached => true, :input => patch))
      rescue CommandFailed
        return false
      end
      native(:write_tree, :env => options[:env]).to_s.chomp!
    end
def apply_patch ( head_sha , patch ) git_index = create_tempfile ( 'index' , true ) options = { :env => { 'GIT_INDEX_FILE' => git_index } , :raise => true } begin native ( :read_tree , options . dup , head_sha ) native ( :apply , options . merge ( :cached => true , :input => patch ) ) rescue CommandFailed return false end native ( :write_tree , :env => options [ :env ] ) . to_s . chomp! end
Applies the given patch against the given SHA of the current repo.
Applies the given patch against the given SHA of the current repo .
head_sha
patch