From 57b9ca5ea586f3b90c6f2af3dbac967262ca94a6 Mon Sep 17 00:00:00 2001 From: irengrig Date: Mon, 7 Dec 2009 19:17:51 +0300 Subject: [PATCH] logging for "git does not return any changes" --- .../openapi/vcs/changes/ChangeListManagerImpl.java | 15 ++++++++++++++- .../git4idea/src/git4idea/changes/GitChangeProvider.java | 8 +++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java index 56e32e7d2c..caaf67221e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java @@ -310,7 +310,20 @@ public class ChangeListManagerImpl extends ChangeListManagerEx implements Projec if (updateUnversionedFiles && !wasEverythingDirty) { composite.cleanScope(adjustedScope); } - actualUpdate(wasEverythingDirty, composite, builder, adjustedScope, vcs, changeListWorker, gate); + + try { + actualUpdate(wasEverythingDirty, composite, builder, adjustedScope, vcs, changeListWorker, gate); + } + catch (Throwable t) { + LOG.info(t); + if (t instanceof Error) { + throw (Error) t; + } else if (t instanceof RuntimeException) { + throw (RuntimeException) t; + } + throw new RuntimeException(t); + } + if (myUpdateException != null) break; } diff --git a/plugins/git4idea/src/git4idea/changes/GitChangeProvider.java b/plugins/git4idea/src/git4idea/changes/GitChangeProvider.java index d51ead9293..5a0aac1249 100644 --- a/plugins/git4idea/src/git4idea/changes/GitChangeProvider.java +++ b/plugins/git4idea/src/git4idea/changes/GitChangeProvider.java @@ -15,6 +15,7 @@ */ package git4idea.changes; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.project.Project; @@ -35,6 +36,7 @@ import java.util.Set; * Git repository change provider */ public class GitChangeProvider implements ChangeProvider { + private static final Logger LOG = Logger.getInstance("#git4idea.changes.GitChangeProvider"); /** * the project */ @@ -56,7 +58,11 @@ public class GitChangeProvider implements ChangeProvider { final ChangelistBuilder builder, final ProgressIndicator progress, final ChangeListManagerGate addGate) throws VcsException { - Collection roots = GitUtil.gitRootsForPaths(dirtyScope.getAffectedContentRoots()); + final Collection affected = dirtyScope.getAffectedContentRoots(); + Collection roots = GitUtil.gitRootsForPaths(affected); + if (roots.size() != affected.size()) { + LOG.info("affected content roots size: " + affected.size() + " roots size: " + roots.size()); + } final MyNonChangedHolder holder = new MyNonChangedHolder(myProject, dirtyScope.getDirtyFilesNoExpand()); -- 2.11.4.GIT