Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

Commit 8134fe0e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

git host fixed

parent 6d29d7a25f07
......@@ -70,7 +70,7 @@ def render_404
end
def require_non_empty_project
redirect_to @project unless @project.repo_exists?
redirect_to @project unless @project.repo_exists? && @project.has_commits?
end
def respond_with_notes
......
......@@ -65,7 +65,7 @@ def update
end
def show
return render "projects/empty" unless @project.repo_exists?
return render "projects/empty" unless @project.repo_exists? && @project.has_commits?
limit = (params[:limit] || 20).to_i
@activities = @project.cached_updates(limit)
end
......
......@@ -52,6 +52,8 @@ def define_tree_vars
@commit = project.commit(@ref)
@tree = Tree.new(@commit.tree, project, @ref, params[:path])
@tree = TreeDecorator.new(@tree)
rescue
return render_404
end
def ref
......
......@@ -19,7 +19,7 @@ def set_identifier
end
def update_gitosis
GitoProxy.system.new.configure do |c|
Gitlabhq::GitHost.system.new.configure do |c|
c.update_keys(identifier, key)
projects.each do |project|
......@@ -29,7 +29,7 @@ def update_gitosis
end
def gitosis_delete_key
GitoProxy.system.new.configure do |c|
Gitlabhq::GitHost.system.new.configure do |c|
c.delete_key(identifier)
projects.each do |project|
......
......@@ -95,6 +95,10 @@ def commit_notes(commit)
notes.where(:noteable_id => commit.id, :noteable_type => "Commit")
end
def has_commits?
!!commit
end
def add_access(user, *access)
opts = { :user => user }
access.each { |name| opts.merge!(name => true) }
......
......@@ -11,7 +11,7 @@ email:
# But gitosis wiil be deprecated &
# some new features wont work with it
git_host:
system: gitolite# or gitosis
system: gitolite
admin_uri: git@localhost:gitolite-admin
base_path: /home/git/repositories/
host: localhost
......
......@@ -4,10 +4,10 @@
module Gitlabhq
class GitHost
def self.system
if GIT_HOST["system"] == "gitolite"
Gitlabhq::Gitolite
else
if GIT_HOST["system"] == "gitosis"
Gitlabhq::Gitosis
else
Gitlabhq::Gitolite
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment