summaryrefslogtreecommitdiff
path: root/app/services/projects
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/projects')
-rw-r--r--app/services/projects/fork_service.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/services/projects/fork_service.rb b/app/services/projects/fork_service.rb
index 8bb0fcf9474..6b0d4aca3e1 100644
--- a/app/services/projects/fork_service.rb
+++ b/app/services/projects/fork_service.rb
@@ -14,7 +14,7 @@ module Projects
project.name = @from_project.name
project.path = @from_project.path
project.creator = @current_user
- if @from_project.avatar && @from_project.avatar.image?
+ if @from_project.avatar.present? && @from_project.avatar.image?
project.avatar = @from_project.avatar
end
@@ -42,16 +42,16 @@ module Projects
end
#Now fork the repo
unless gitlab_shell.fork_repository(@from_project.path_with_namespace, project.namespace.path)
- raise "forking failed in gitlab-shell"
+ raise 'forking failed in gitlab-shell'
end
project.ensure_satellite_exists
end
rescue => ex
- project.errors.add(:base, "Fork transaction failed.")
+ project.errors.add(:base, 'Fork transaction failed.')
project.destroy
end
else
- project.errors.add(:base, "Invalid fork destination")
+ project.errors.add(:base, 'Invalid fork destination')
end
project