Fail safe in case of "conflict not found" issue during git merge

assertTrue just logs the message and doesn't prevent the NPE on the
next line.
This commit is contained in:
Kirill Likhodedov
2017-02-26 11:05:14 +00:00
parent c5c5c3ffc0
commit d4f00a3df8
@@ -464,8 +464,11 @@ public class GitMergeProvider implements MergeProvider2 {
for (VirtualFile f : files) {
String path = VcsFileUtil.relativePath(root, f);
Conflict c = cs.get(path);
LOG.assertTrue(c != null, String.format("The conflict not found for file: %s(%s)%nFull ls-files output: %n%s%nAll files: %n%s",
f.getPath(), path, output, files));
if (c == null) {
LOG.error(String.format("The conflict not found for file: %s(%s)%nFull ls-files output: %n%s%nAll files: %n%s",
f.getPath(), path, output, files));
continue;
}
c.myFile = f;
if (c.myStatusTheirs == null) {
c.myStatusTheirs = Conflict.Status.DELETED;