Fix the limit logic for containing refs requests
What does this MR do and why?
Contributes to #464012 (closed)
Problem
We apply a limitation for number of references before excluding tipped references. For example, with limit equal 5 and 3 excluded references the final result will be include only 2 refs, instead of potential 5.
Solution
-
Increase the requested limit by number of excluded references.
That will guarantee that we fullfil the requested limit
-
Apply an upper limit for results
To exclude additional references in case when the result has more than requested number of refs.
How to set up and validate locally
Edited by Vasilii Iakliushin