From 944d3823c32c0b5d336efb8a7a44eb73bfae4f38 Mon Sep 17 00:00:00 2001 From: David Barri Date: Fri, 9 Nov 2012 08:32:00 +1100 Subject: [PATCH] Fix for git commit when nothing to commit. Turns out git commit returns with 128 when user.name config not present. --- lib/gitlab/backend/gitolite_config.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/backend/gitolite_config.rb b/lib/gitlab/backend/gitolite_config.rb index a54608eb..cb931861 100644 --- a/lib/gitlab/backend/gitolite_config.rb +++ b/lib/gitlab/backend/gitolite_config.rb @@ -192,7 +192,9 @@ module Gitlab def push tmp_dir Dir.chdir(File.join(tmp_dir, "gitolite")) raise "Git add failed." unless system('git add -A') - raise "Git commit failed." unless system('git commit -am "GitLab"') + system('git commit -m "GitLab"') # git commit returns 0 on success, and 1 if there is nothing to commit + raise "Git commit failed." unless [0,1].include? $?.exitstatus + if system('git push') Dir.chdir(Rails.root) else