diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-10-19 13:27:03 -0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-11-03 14:33:24 -0300 |
commit | 3f0233e5b531b44b2c276c8e8f536af6d2c15db3 (patch) | |
tree | 4dae2189359ed689921bbc376e362d0beb517e09 /app | |
parent | 88d2517e362accea4e51947e49a2587b5012dbc6 (diff) | |
download | gitlab-ce-3f0233e5b531b44b2c276c8e8f536af6d2c15db3.tar.gz |
Create a Wiki Repository's raw_repository properly
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project_wiki.rb | 2 | ||||
-rw-r--r-- | app/models/repository.rb | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index bb7be29ef66..43de6809178 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -135,7 +135,7 @@ class ProjectWiki end def repository - @repository ||= Repository.new(full_path, @project, disk_path: disk_path) + @repository ||= Repository.new(full_path, @project, disk_path: disk_path, is_wiki: true) end def default_branch diff --git a/app/models/repository.rb b/app/models/repository.rb index 44a1e9ce529..b1081db2e15 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -17,7 +17,7 @@ class Repository include Gitlab::ShellAdapter include RepositoryMirroring - attr_accessor :full_path, :disk_path, :project + attr_accessor :full_path, :disk_path, :project, :is_wiki delegate :ref_name_for_sha, to: :raw_repository @@ -72,11 +72,12 @@ class Repository end end - def initialize(full_path, project, disk_path: nil) + def initialize(full_path, project, disk_path: nil, is_wiki: false) @full_path = full_path @disk_path = disk_path || full_path @project = project @commit_cache = {} + @is_wiki = is_wiki end def ==(other) @@ -1141,7 +1142,7 @@ class Repository end def initialize_raw_repository - Gitlab::Git::Repository.new(project.repository_storage, disk_path + '.git', Gitlab::GlRepository.gl_repository(project, false)) + Gitlab::Git::Repository.new(project.repository_storage, disk_path + '.git', Gitlab::GlRepository.gl_repository(project, is_wiki)) end def find_commits_by_message_by_shelling_out(query, ref, path, limit, offset) |