spec/support/repo.rb
def new_commit_edit_new_file(repo)
  oid = repo.write("I'm a new changelog with different text", :blob)
  index = repo.index
  index.read_tree(repo.head.target.tree)
  index.add(path: "encoding/CHANGELOG", oid: oid, mode: 0100644)

  options = commit_options(repo, index, "Edit encoding/CHANGELOG")

  sha = Rugged::Commit.create(repo, options)
  repo.lookup(sha)
end
# Writes a new commit to the repo and returns a Rugged::Commit.  Replaces the
# contents of encoding/CHANGELOG with new text.
Writes a new commit to the repo and returns a Rugged::Commit.  Replaces the
contents of encoding/CHANGELOG with new text.
Writes a new commit to the repo and returns a Rugged :: Commit . Replaces the contents of encoding / CHANGELOG with new text .
def new_commit_edit_new_file(repo)
  oid = repo.write("I'm a new changelog with different text", :blob)
  index = repo.index
  index.read_tree(repo.head.target.tree)
  index.add(path: "encoding/CHANGELOG", oid: oid, mode: 0100644)
  options = commit_options(repo, index, "Edit encoding/CHANGELOG")
  sha = Rugged::Commit.create(repo, options)
  repo.lookup(sha)
end
def new_commit_edit_new_file ( repo ) oid = repo . write ( "I'm a new changelog with different text" , :blob ) index = repo . index index . read_tree ( repo . head . target . tree ) index . add ( path : "encoding/CHANGELOG" , oid : oid , mode : 0100644 ) options = commit_options ( repo , index , "Edit encoding/CHANGELOG" ) sha = Rugged :: Commit . create ( repo , options ) repo . lookup ( sha ) end
Writes a new commit to the repo and returns a Rugged::Commit.
Writes a new commit to the repo and returns a Rugged :: Commit .
repo