Added projects. Part 7
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user