From a000a599d3c181d664fcb80d46d87a67cf3848b8 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Mon, 14 Jul 2014 10:04:02 +0300 Subject: 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. --- lib/oxidized/output/git.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1