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
Describe the bug
When sbm.gitSupportEnabled=true and
having a project which does not contain .git but one of it's parent dirs do
and a recipe is successfully applied
then the commit is empty because the modified resources were not added.
To Reproduce
Given a project setup like this:
parent-dir/.git <-- some parent of scanned dir
parent-dir/scanned-dir <-- was scanned
Run a recipe that modifies resources (e.g. migrate-jpa-to-spring-boot where files are deleted and modified)
The resulting commit will not contain any resources and git status will be not clean as modified resources were not added to the index
Expected behavior
All resources modified by the recipe should have been added to the git index and be part of the commit.
Additional context
The problem is that the absolute paths for resources added to the index are relativized to the project's root path.
Thus the relative path is wrong, the resources are not added and the commit is empty.
The path must be calculated relative to the dir that contains the .git dir
Describe the bug
When
sbm.gitSupportEnabled=true
andhaving a project which does not contain
.git
but one of it's parent dirs doand a recipe is successfully applied
then the commit is empty because the modified resources were not added.
To Reproduce
Given a project setup like this:
migrate-jpa-to-spring-boot
where files are deleted and modified)git status
will be not clean as modified resources were not added to the indexExpected behavior
All resources modified by the recipe should have been added to the git index and be part of the commit.
Additional context
The problem is that the absolute paths for resources added to the index are relativized to the project's root path.
Thus the relative path is wrong, the resources are not added and the commit is empty.
The path must be calculated relative to the dir that contains the
.git
dirSee:
GitSupport.makeRelativeToRepositoryLocation()
The text was updated successfully, but these errors were encountered: