`ee_compat_check` sometimes fail with a `repository lacks the necessary blob to fall back on 3-way merge` error
As seen in https://gitlab.com/gitlab-org/gitlab-ce/builds/15974810, the patch doesn't apply cleanly but does apply cleanly if you run the steps advertised by the job:
# In the EE repo
$ git fetch https://gitlab.com/gitlab-org/gitlab-ce.git 32016-fix-slash-commands-detection
$ git cherry-pick SHA # Repeat for all the commits you want to pick
In this case, the repo has the necessary history to resolve the conflict using a 3-way merge.
Otherwise, without fetching CE, you'd get the following error:
› git apply --check --3way 32016-fix-slash-commands-detection.patch
error: patch failed: app/assets/javascripts/notes.js:24
error: repository lacks the necessary blob to fall back on 3-way merge.
error: app/assets/javascripts/notes.js: patch does not apply
The thing is that the job is not showing the output of git apply --check --3way patch
so it makes it harder to debug.
Solution:
-
Display the output of git apply --check --3way patch
to ease the debugging -
Run git fetch https://gitlab.com/gitlab-org/gitlab-ce.git <ce-branch>
before runninggit apply --check --3way patch
/cc @kushalpandya