spec/support/repo.rb
# Writes a new commit to the repo and returns a Rugged::Commit.  Replaces the
# contents of CHANGELOG with a single new line of text.
Writes a new commit to the repo and returns a Rugged::Commit.  Replaces the
contents of CHANGELOG with a single new line of text.
Writes a new commit to the repo and returns a Rugged :: Commit . Replaces the contents of CHANGELOG with a single new line of text .
def new_commit_edit_old_file(repo)
  oid = repo.write("I replaced the changelog with this text", :blob)
  index = repo.index
  index.read_tree(repo.head.target.tree)
  index.add(path: "CHANGELOG", oid: oid, mode: 0100644)
  options = commit_options(
    repo,
    index,
    "Edit CHANGELOG in its original location"
  )
  sha = Rugged::Commit.create(repo, options)
  repo.lookup(sha)
end
def new_commit_edit_old_file ( repo ) oid = repo . write ( "I replaced the changelog with this text" , :blob ) index = repo . index index . read_tree ( repo . head . target . tree ) index . add ( path : "CHANGELOG" , oid : oid , mode : 0100644 ) options = commit_options ( repo , index , "Edit CHANGELOG in its original location" ) 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