Make sure that we have author and committer

In case we don't have it setup in ~/.gitconfig
This commit is contained in:
Lin Jen-Shin 2017-08-08 20:35:38 +08:00
parent d831e8e1d0
commit 75096f958c
1 changed files with 3 additions and 0 deletions

View File

@ -64,10 +64,13 @@ describe Gitlab::EncodingHelper do
index.read_tree(repo.head.target.tree) unless repo.empty?
index.add(path: path, oid: oid, mode: 0100644)
user = { name: 'Test', email: 'test@example.com' }
Rugged::Commit.create(
repo,
tree: index.write_tree(repo),
author: user,
committer: user,
message: "Update #{path}",
parents: repo.empty? ? [] : [repo.head.target].compact,
update_ref: 'HEAD'