Tree#diff: unexpected behavior of option :ignore_submodules
| :ignore_submodules | if true, submodules will be excluded from the diff completely. |
|---|
Problem
repo = Rugged::Repository.new('.')
commit = repo.head.target_id
diff = Rugged::Tree.diff(repo, nil, commit, ignore_submodules: true)
I expect excluding all submodules files but have following:
diff.patches.map { |p| p.delta.new_file[:path] }
=> [".gitmodules", "submodule_repo"]
What is wrong with it?
diff will not recursively open submodules and display their changes, it will only show you that a submodule has changed. If you want to see the changes in the submodule you will need to open it and run the diff in that repository as well.
Thanks, @ethomson.
I understand that I can work with submodules like independent repositories but want to ignore ones in base repository diff. Could you explain me how do it and what is :ignore_submodules option for?
Thanks for clarifying @alexey-igrychev, I misread your question. Indeed I do not know why that's behaving that way at the moment. Will have to investigate.