Commit 944d3823c32c0b5d336efb8a7a44eb73bfae4f38
1 parent
6f25967c
Exists in
master
and in
4 other branches
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,7 +192,9 @@ module Gitlab | ||
192 | def push tmp_dir | 192 | def push tmp_dir |
193 | Dir.chdir(File.join(tmp_dir, "gitolite")) | 193 | Dir.chdir(File.join(tmp_dir, "gitolite")) |
194 | raise "Git add failed." unless system('git add -A') | 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 | if system('git push') | 198 | if system('git push') |
197 | Dir.chdir(Rails.root) | 199 | Dir.chdir(Rails.root) |
198 | else | 200 | else |