[git] more diagnostic for EA-62663
authorJulia Beliaeva <Julia.Beliaeva@jetbrains.com>
Thu, 20 Oct 2016 02:10:52 +0000 (05:10 +0300)
committerJulia Beliaeva <julia.beliaeva@jetbrains.com>
Thu, 20 Oct 2016 21:27:03 +0000 (00:27 +0300)
plugins/git4idea/src/git4idea/history/GitHistoryUtils.java

index b2f721479513103c61c8ed4b6973b1e9cf7edda7..74e7cc0066f5acbe7fae7eae24014c5ab990573c 100644 (file)
@@ -840,7 +840,9 @@ public class GitHistoryUtils {
         Collection<VcsRef> refsInRecord = parseRefs(record.getRefs(), commit.getId(), factory, root);
         for (VcsRef ref : refsInRecord) {
           if (!refs.add(ref)) {
-            LOG.error("Adding duplicate element to the set");
+            // relying on the fact that intersection method puts elements of the first argument into the result
+            VcsRef otherRef = ContainerUtil.getFirstItem(ContainerUtil.intersection(refs, Collections.singleton(ref)));
+            LOG.error("Adding duplicate element " + ref + " to the set containing " + otherRef);
           }
         }
         return commit;