You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #937 Updating Recipe Fails When Project Located in Subfolder in Git Repository (Peukku, Mikko Peltola)
This PR was merged into the 1.x branch.
Discussion
----------
Updating Recipe Fails When Project Located in Subfolder in Git Repository
Closes#918 and #864
Updating Recipe fails when symfony project is not in the root of git project.
As a developer the most problematic thing is that it fails without any errors. Some files are just not updated.
There is a simple project with commands needed to reproduce to see what is happening before the fix: https://github.com/Peukku/symfony-flex-reproducer-918-project-root/
I think there are two reasons for this to happen:
* $patchString is created with git diff in tmpPath, which has a temporary flat git repository (with no path prefix), but applied bit later in project context where path would be needed.
* Location of .git directory is assumed to be in project root, when it actually is in git root level. (or in .git/modules/[subproject] when using git submodules). The blobs do get written, but in the wrong location.
This PR uses git binary to resolve location of .git folder and current relative path to be used as the prefix for git diff.
Commits
-------
637b769 tweak coding standards
48e5039 Refactored getBlobPath() for clarity, added testApplyPatchOnSubfolder() using same dataprovider as is used for testApplyPatch()
ae675dc Use git binary to resolve location of .git folder and current relative path
0 commit comments