I faced an unexpected behaviour during cherry-picking a commit to a branch with a submodule. Git graph: A -- B [master] \ `- C -- D [test] Both branches have a file with name `a_file`. It has been added by commit A.Commits B and C add a folder with name `a_submodule` to the respective branches.
Commit C does it regularly by adding a file with name `a_submodule/content`. Commit B adds a submodule with name `a_submodule`. Commit D only modifies `a_file`. Note that `a_file` and `a_submodule` are not related. [repo] |- a_file `- a_submodule When I trying to cherry pick commit D on commit B, I got a conflict with `a_submodule`. Changes of `a_file` are successfully cherry-picked. I expected, that there would be no conflicts. A bash script reproducing the bug is attached. Vasily.
Attachment:
bug.sh
Description: application/shellscript