-
-
Notifications
You must be signed in to change notification settings - Fork 196
Description
Symfony version(s) affected
5.4.4
Description
Project Setup
We are using a project structure that leverages git sub-modules, i.e.
root
-> project1
-> project2 (checked-out)
The .git
"folder" is actually a file thereof, pointing to the "parent" .git
folder:
# cat root/project2/.git
gitdir: ../.git/modules/project2
Problem
When I now run the command to update a recipe (it doesn't matter which one it is), I'm greeted with this error:
user@computer:/root/project2$ composer recipes:update symfony/security-bundle
Updating recipe for symfony/security-bundle...
There was an error applying the recipe update patch
Failed to create "./.git/objects/e9": mkdir(): Not a directory.
Update the recipe by re-installing the latest version with:
composer recipes:install symfony/security-bundle --force -v
Issue: Composer tries to work with the .git
folder as usual, not being aware of the concept about git sub-modules.
The provided solution here is to just nuke the existing code and "start fresh". That works of course, but could be "cleaner".
How to reproduce
I think the description says enough already, but:
- Create a git repository
- Add a sub-module with a Symfony project
- Try to update a recipe
Possible Solution
Not sure about a solution here.
We would probably need to make composer aware about the git sub-module concept and make it follow the link to the "actual" .git
folder.
But the provided solution to just "nuke" the existing code is also fine, when the above cannot be achieved easily.
Additional Context
No response