summaryrefslogtreecommitdiff
path: root/lib/oxidized/output/git.rb
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2014-07-14 10:04:02 +0300
committerSaku Ytti <saku@ytti.fi>2014-07-14 10:04:02 +0300
commita000a599d3c181d664fcb80d46d87a67cf3848b8 (patch)
treef472c9d4e1aff4584f16d79381a2017d1307396d /lib/oxidized/output/git.rb
parent1dae1df030f06f97c38cd928f13fd8319aca4cfb (diff)
Allow it to work without local existing config
Even after manually setting author+committer, it still crashed with: Config value 'user.name' was not found [Rugged::ConfigError] Not sure where it would want to use it, after author+committer already are set, but I guess this method is more robust anyhow.
Diffstat (limited to 'lib/oxidized/output/git.rb')
-rw-r--r--lib/oxidized/output/git.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/oxidized/output/git.rb b/lib/oxidized/output/git.rb
index 848608f..18c2cc1 100644
--- a/lib/oxidized/output/git.rb
+++ b/lib/oxidized/output/git.rb
@@ -64,12 +64,13 @@ class Git < Output
tree_new = index.write_tree repo
if tree_old != tree_new
+ repo.config['user.name'] = user
+ repo.config['user.email'] = email
Rugged::Commit.create(repo,
:tree => index.write_tree(repo),
:message => msg,
:parents => repo.empty? ? [] : [repo.head.target].compact,
:update_ref => 'HEAD',
- :author => {:name=>user, :email=>email, :time=>Time.now.utc}
)
end
end