[git] IDEA-81563 Correctly identify Git root for submodule changes

When the submodule is changed in the super-project, the root of this
change is this super-project, not the submodule root.

In particular, this led to exception when trying to merge conflicts
when one of conflicts was the submodule.
This commit is contained in:
Kirill Likhodedov
2014-12-23 16:03:02 +03:00
parent b284bfc85f
commit 169bf44357
+2 -1
View File
@@ -180,7 +180,8 @@ public class GitUtil {
throws VcsException {
Map<VirtualFile, List<VirtualFile>> result = new HashMap<VirtualFile, List<VirtualFile>>();
for (VirtualFile file : virtualFiles) {
final VirtualFile vcsRoot = gitRootOrNull(file);
// directory is reported only when it is a submodule => it should be treated in the context of super-root
final VirtualFile vcsRoot = gitRootOrNull(file.isDirectory() ? file.getParent() : file);
if (vcsRoot == null) {
if (ignoreNonGit) {
continue;