[git] minor: inline parameter that is never changed
authorJulia Beliaeva <Julia.Beliaeva@jetbrains.com>
Sat, 8 Oct 2016 20:49:11 +0000 (23:49 +0300)
committerJulia Beliaeva <Julia.Beliaeva@jetbrains.com>
Tue, 11 Oct 2016 16:32:30 +0000 (19:32 +0300)
plugins/git4idea/src/git4idea/history/GitHistoryUtils.java
plugins/git4idea/src/git4idea/log/GitLogProvider.java

index 5a7717713f26b4b6d6e6308c3fb770b89b27c066..64af278497286192843152a81a2f1b1ce660f3b2 100644 (file)
@@ -818,7 +818,6 @@ public class GitHistoryUtils {
   @NotNull
   public static VcsLogProvider.DetailedLogData loadMetadata(@NotNull final Project project,
                                                             @NotNull final VirtualFile root,
-                                                            final boolean withRefs,
                                                             String... params) throws VcsException {
     final VcsLogObjectsFactory factory = getObjectsFactoryWithDisposeCheck(project);
     if (factory == null) {
@@ -826,14 +825,12 @@ public class GitHistoryUtils {
     }
     final Set<VcsRef> refs = new OpenTHashSet<>(GitLogProvider.DONT_CONSIDER_SHA);
     final List<VcsCommitMetadata> commits =
-      loadDetails(project, root, withRefs, false, record -> {
+      loadDetails(project, root, true, false, record -> {
         GitCommit commit = createCommit(project, root, record, factory);
-        if (withRefs) {
-          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");
-            }
+        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");
           }
         }
         return commit;
index dba6459a54b904bac66ecda22c0e43ed378d3931..04712fde06dfdc8c2b4e1ba6f3b3539ef6d42a25 100644 (file)
@@ -106,7 +106,7 @@ public class GitLogProvider implements VcsLogProvider {
 
     boolean refresh = requirements instanceof VcsLogProviderRequirementsEx && ((VcsLogProviderRequirementsEx)requirements).isRefresh();
 
-    DetailedLogData data = GitHistoryUtils.loadMetadata(myProject, root, true, params);
+    DetailedLogData data = GitHistoryUtils.loadMetadata(myProject, root, params);
 
     Set<VcsRef> safeRefs = data.getRefs();
     Set<VcsRef> allRefs = new OpenTHashSet<>(safeRefs, DONT_CONSIDER_SHA);
@@ -292,7 +292,7 @@ public class GitLogProvider implements VcsLogProvider {
     params.add("--max-count=" + commitCount);
     params.addAll(unmatchedTags);
     sw.report();
-    return GitHistoryUtils.loadMetadata(myProject, root, true, ArrayUtil.toStringArray(params));
+    return GitHistoryUtils.loadMetadata(myProject, root, ArrayUtil.toStringArray(params));
   }
 
   @Override