localrepo: Revert refactorings of tree entries helpers
This reverts 319f0593 (Merge branch 'jc/tree-improvements' into 'master', 2023-05-09), which has introduced a bunch of refactorings for our tree entries helpers in the localrepo package. These refactorings caused failures in Rails:
1) API::Submodules PUT /projects/:id/repository/submodule/:submodule when authenticated as a developer returns the commit
Failure/Error: expect(response).to have_gitlab_http_status(:ok)
expected the response to have status code :ok but it was 400. The response was: {"message":"13:submodule subcommand: write tree: writing tree: exit status 128."}
# ./spec/requests/api/submodules_spec.rb:72:in `block (4 levels) in <main>'
# ./spec/spec_helper.rb:423:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:415:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:411:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:61:in `with_raw_context'
# ./spec/spec_helper.rb:411:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:242:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/fast_quarantine.rb:39:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:108:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:62:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:108:in `block (2 levels) in <main>'
2) API::Submodules PUT /projects/:id/repository/submodule/:submodule when authenticated as a developer when the submodule name is urlencoded returns the commit
Failure/Error: expect(response).to have_gitlab_http_status(:ok)
expected the response to have status code :ok but it was 400. The response was: {"message":"13:submodule subcommand: write tree: writing tree: exit status 128."}
# ./spec/requests/api/submodules_spec.rb:92:in `block (5 levels) in <main>'
# ./spec/spec_helper.rb:423:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:415:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:411:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:61:in `with_raw_context'
# ./spec/spec_helper.rb:411:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:242:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/fast_quarantine.rb:39:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:108:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:62:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:108:in `block (2 levels) in <main>'
Edited by Patrick Steinhardt