I recently began using Rugged, and have already run into some problems. Basically all I want to do is add everything in a Git repo, commit the staged changes, and push everything to a branch. I've started out with the first step as follows:
@repo = Rugged::Repository.new(Dir.pwd)
@index = @repo.index
def git_add
@index.add mode: 'add-all'
end
But the console ends up screaming at me. I browsed through libgit2's documentation, and couldn't find any examples of adding everything in repo. Some thorough Googling yielded similar results. I could probably have just jammed in a @repo.workdir.entries
as the path
parameter for index.add
, but I'm not sure. Is there a better way to go about this?