summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-12-19 10:57:12 +0100
committerBob Van Landuyt <bob@vanlanduyt.co>2017-12-19 17:06:18 +0100
commitac862490392b029ac4937188e02bdf09f4505869 (patch)
tree87863bcffe6f69d4adc72c40ac87315d2e7cdb6a /app
parent7ed3759ebb196dc7466b63cabbe12ed43ee7b286 (diff)
downloadgitlab-ce-ac862490392b029ac4937188e02bdf09f4505869.tar.gz
Don't link LFS-objects multiple times.bvl-fix-unlinking-with-lfs-objects
If Unlinking a fork would fail somewhere after this, the LFS objects might still be linked. Which would cause issues when trying to destroy a project.
Diffstat (limited to 'app')
-rw-r--r--app/services/projects/unlink_fork_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/projects/unlink_fork_service.rb b/app/services/projects/unlink_fork_service.rb
index c499f384426..842fe4e09c4 100644
--- a/app/services/projects/unlink_fork_service.rb
+++ b/app/services/projects/unlink_fork_service.rb
@@ -5,7 +5,7 @@ module Projects
if fork_source = @project.fork_source
fork_source.lfs_objects.find_each do |lfs_object|
- lfs_object.projects << @project
+ lfs_object.projects << @project unless lfs_object.projects.include?(@project)
end
refresh_forks_count(fork_source)