Skip to content
Snippets Groups Projects
Unverified Commit 0bdaba27 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

moved sanitized path to correct location

parent 7b43c44c
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ class Communication::Website::GitFile < ApplicationRecord
end
def path
@path ||= about.git_path(website)
@path ||= about.git_path(website)&.gsub(/\/+/, '/')
end
def sha
......
......@@ -37,9 +37,9 @@ class Git::Repository
def sync_git_files
git_files.each do |file|
if file.should_create?
provider.create_file sanitized_path(file.path), file.to_s
provider.create_file file.path, file.to_s
elsif file.should_update?
provider.update_file sanitized_path(file.path), file.previous_path, file.to_s
provider.update_file file.path, file.previous_path, file.to_s
elsif file.should_destroy?
provider.destroy_file file.previous_path
end
......@@ -48,11 +48,7 @@ class Git::Repository
def mark_as_synced
git_files.each do |git_file|
git_file.update previous_path: sanitized_path(git_file.path), previous_sha: git_file.sha
git_file.update previous_path: git_file.path, previous_sha: git_file.sha
end
end
def sanitized_path(path)
path&.gsub(/\/+/, '/')
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment