Commit graph

8 commits

Author SHA1 Message Date
Bob Van Landuyt
ac86249039 Don't link LFS-objects multiple times.
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.
2017-12-19 17:06:18 +01:00
Bob Van Landuyt
7582bc8b4e Unlink a project from a fork network when it's source was deleted.
We need to close all merge requests coming from the project within the
entire fork network.
2017-11-03 12:17:59 +01:00
Bob Van Landuyt
2c0b677604 Fix errors when deleting a forked project
The problem would occur when the `ForkedProjectLink` was deleted, but
the `ForkNetworkMember` was not. The delete would be rolled back and
retried.

But the error would not be saved because `Project#forked?`
would still be true, because the `ForkNetworkMember` exists. But the
`Project#forked_project_link` would be `nil`. So the validation for
the visibility level would fail.
2017-10-17 16:46:07 +02:00
Bob Van Landuyt
8160550439 Remove membership from fork network when unlinking 2017-10-07 11:46:23 +02:00
Yorick Peterse
aef9f1eb94
Cache the number of forks of a project
The number of forks of a project doesn't change very frequently and
running a COUNT(*) every time this information is requested can be quite
expensive. We also end up running such a COUNT(*) query at least twice
on the homepage of a project.

By caching this data and refreshing it when necessary we can reduce
project homepage loading times by around 60 milliseconds (based on the
timings of https://gitlab.com/gitlab-org/gitlab-ce).
2017-08-14 18:00:28 +02:00
Douwe Maan
70b05a8377 Split up MergeRequestsController 2017-06-28 18:17:44 -05:00
Baldinof
a6b5b50e14 Fix incorrect variable name 2016-04-04 14:41:01 +00:00
Baldinof
fa4126acff Move unlink fork logic to a service 2016-03-22 15:34:35 +01:00