Skip to content

Commit ba8b894

Browse files
author
root
committed
Fix #358
1 parent 79caa9e commit ba8b894

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Diff for: app/helpers/gitolite_plugin_settings_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def image_for_param(bool)
2020

2121

2222
def render_gitolite_version(version)
23-
if version <= 0
23+
if version.nil?
2424
css_class = 'label label-important'
2525
label = l(:label_unknown_gitolite_version)
2626
else

Diff for: lib/redmine_git_hosting/commands/gitolite.rb

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ def gitolite_infos
2323

2424

2525
def sudo_update_gitolite!
26+
if gitolite_command.nil?
27+
logger.error("gitolite_command is nil, can't update Gitolite !")
28+
return
29+
end
2630
logger.info("Running '#{gitolite_command.join(' ')}' on the Gitolite install ...")
2731
begin
2832
sudo_shell(*gitolite_command)

Diff for: lib/redmine_git_hosting/config/gitolite_infos.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def gitolite_infos
2121
begin
2222
RedmineGitHosting::Commands.gitolite_infos
2323
rescue RedmineGitHosting::Error::GitoliteCommandException => e
24-
logger.error('Error while getting Gitolite infos')
24+
logger.error('Error while getting Gitolite infos, check your SSH keys path or your Git user.')
2525
nil
2626
end
2727
end
@@ -40,14 +40,14 @@ def gitolite_banner
4040

4141

4242
def find_version(output)
43-
return 0 if output.blank?
43+
return nil if output.blank?
4444
line = output.split("\n")[0]
4545
if line =~ /gitolite[ -]v?2./
4646
2
4747
elsif line.include?('running gitolite3')
4848
3
4949
else
50-
0
50+
nil
5151
end
5252
end
5353

0 commit comments

Comments
 (0)