This instance will be upgraded to Heptapod 0.27.1 on 2021-12-08 at 22:00 UTC+1 (a few minutes of down time)

Commit 16107364 authored by Gabriel Mazetto's avatar Gabriel Mazetto
Browse files

Make disk_path keyword argument and optional

parent e40b6b7b99c7
......@@ -480,7 +480,7 @@ def team
end
def repository
@repository ||= Repository.new(full_path, disk_path, self)
@repository ||= Repository.new(full_path, self, disk_path: disk_path)
end
def container_registry_url
......@@ -980,9 +980,8 @@ def personal?
# Expires various caches before a project is renamed.
def expire_caches_before_rename(old_path)
# TODO: if we start using UUIDs for cache, we don't need to do this HACK anymore
repo = Repository.new(old_path, old_path, self)
wiki = Repository.new("#{old_path}.wiki", "#{old_path}.wiki", self)
repo = Repository.new(old_path, self)
wiki = Repository.new("#{old_path}.wiki", self)
if repo.exists?
repo.before_delete
......
......@@ -138,7 +138,7 @@ def search_files(query)
end
def repository
@repository ||= Repository.new(full_path, disk_path, @project)
@repository ||= Repository.new(full_path, @project, disk_path: disk_path)
end
def default_branch
......
......@@ -52,9 +52,9 @@ def self.cache_method(name, fallback: nil, memoize_only: false)
end
end
def initialize(full_path, disk_path, project)
def initialize(full_path, project, disk_path: nil)
@full_path = full_path
@disk_path = disk_path
@disk_path = disk_path || full_path
@project = project
end
......
......@@ -127,7 +127,7 @@ def removal_path(path)
def flush_caches(project)
project.repository.before_delete
Repository.new(wiki_path, repo_path, project).before_delete
Repository.new(wiki_path, project, disk_path: repo_path).before_delete
end
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