Added projects. Part 7

This commit is contained in:
alexey
2025-03-01 23:38:05 +03:00
parent c61763ba56
commit ffe340bcae
5 changed files with 137 additions and 8 deletions

View File

@@ -188,9 +188,7 @@ class GitRepo
f.flock(File::LOCK_SH)
git_path = File.join(@path, repo_name + ".git")
bare_repo = Rugged::Repository.new(git_path)
pp bare_repo.head
pp repo.head
res = (bare_repo.head.oid == repo.head.oid)
res = (bare_repo.head.target.tree.oid == repo.head.target.tree.oid)
end
res
end

View File

@@ -59,6 +59,11 @@ class ProjectsActions
fname
end
def get_project_path_git(id, gitname)
proj_path = get_project_path(id)
File.join(proj_path, PROJECTS_STRUCTURE[:SRC], gitname)
end
def create_project(name, description, configuration)
@error = nil
ret_val = 0

View File

@@ -24,3 +24,9 @@ def check_partname_in_array(filename, search_array)
end
fnd
end
def check_safe_path(filename)
current_dir = Dir.pwd
home_dir = Dir.home
filename.start_with?("/etc/mock") || filename.start_with?(current_dir) || filename.start_with?(home_dir)
end