Skip to content

Handle start and target repositoires being the same in UserCommitFiles

Sami Hiltunen requested to merge smh-identify-same-repo-user-commit-files into master

Gitaly receives requests in UserCommitFiles where the start and the target repositories are the same. In such cases, it doesn't have to resolve the branches from start repository as it is the same. This commit checks if the repositories are the same and only operates on the local repository if that is the case.

This fixes the failing Gitaly deployment gitlab!50170 (closed). The failing test does a request with start repository referring target repository. Similar case was fixed as part of !2811 (merged). The difference here is that the repository is not empty, so checking if the repository has branches does not go around the problem. The test case is creating the branch and thus resolving the branch to a commit fails.

Edited by Sami Hiltunen

Merge request reports