Gitlab CI does git fetch wrong

Problem

Working with Gitlab CI after gradually upgrading from 13.8. * To 13.12. * I found an issue that when used in the Git strategy settings: git fetch jobs don't work as I expect, everything is fine with git clone.

Expecting

When using git clone, I get this consistent result. If git strategy: git fetch is installed, I get the given result by accident. Basically getting a result I don't expect. (Result)

$ git branch
(HEAD detached at cacf9c5355)
$ git version
git version 2.32.0
$ git log origin/dev | wc -l
73083

Result:

$ git branch
(HEAD detached at cacf9c5355)
$ git version
git version 2.32.0
$ git log origin/dev | wc -l
32

Currently installed version of gitlab: gitlab/gitlab-ee:13.12.8-ee.0

The version that roughly started the errors is: gitlab: gitlab/gitlab-ee:13.9.*

I assumed that this behavior is possible due to the use of git client version <2.30, but after the update, nothing has changed.

Tried increasing GIT_DEPTH (=> 200) by jobs but it doesn't work.

Similarly, I assumed that this problem is related, with nx (the current branch is compared with dev for this and depth is needed) described the behavior here.

Edited by Sam Beckham