Commit 944d3823c32c0b5d336efb8a7a44eb73bfae4f38

Authored by David Barri
1 parent 6f25967c

Fix for git commit when nothing to commit.

Turns out git commit returns with 128 when user.name config not present.
Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
lib/gitlab/backend/gitolite_config.rb
... ... @@ -192,7 +192,9 @@ module Gitlab
192 192 def push tmp_dir
193 193 Dir.chdir(File.join(tmp_dir, "gitolite"))
194 194 raise "Git add failed." unless system('git add -A')
195   - raise "Git commit failed." unless system('git commit -am "GitLab"')
  195 + system('git commit -m "GitLab"') # git commit returns 0 on success, and 1 if there is nothing to commit
  196 + raise "Git commit failed." unless [0,1].include? $?.exitstatus
  197 +
196 198 if system('git push')
197 199 Dir.chdir(Rails.root)
198 200 else
... ...