Introduce empty_tree_id to correctly work with SHA256 repository
What does this MR do and why?
Contributes to #441465 (closed)
Problem
We use a hardcoded EMPTY_TREE_ID value to detect the empty repository tree. But SHA256 repositories have a different empty tree id.
Solution
Use repository object format to detect the empty tree id.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Enable feature flag
Feature.enable(:support_sha256_repositories)
- Create a new project in SHA256 format
- Go to the new project page
- Click on
Initial commit
link (something like https://staging.gitlab.com/vyaklushin/my-sha256/-/commit/479c421a108facb7975c0ab51450651be7be2c5bd6940e02e879d363dbdd9aa8) - You should see a 500 error
- Enable feature flag
Feature.enable(:dynamic_empty_tree_id)
- Visit
Initial commit
page again - It should be loaded successfully
Edited by Vasilii Iakliushin