Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions plugin/src/main/java/git4idea/history/GitHistoryUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
*/
package git4idea.history;

import consulo.application.Application;
import consulo.application.util.Semaphore;
import consulo.application.util.registry.Registry;
import consulo.component.ProcessCanceledException;
import consulo.git.localize.GitLocalize;
import consulo.ide.ServiceManager;
import consulo.logging.Logger;
import consulo.process.ProcessOutputTypes;
import consulo.project.Project;
import consulo.util.collection.ArrayUtil;
Expand Down Expand Up @@ -59,6 +57,8 @@
import git4idea.log.GitRefManager;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
Expand All @@ -73,13 +73,13 @@
* A collection of methods for retrieving history information from native Git.
*/
public class GitHistoryUtils {
private static final Logger LOG = LoggerFactory.getLogger(GitHistoryUtils.class);

/**
* A parameter to {@code git log} which is equivalent to {@code --all}, but doesn't show the stuff from index or stash.
*/
public static final List<String> LOG_ALL = Arrays.asList("HEAD", "--branches", "--remotes", "--tags");

private static final Logger LOG = Logger.getInstance(GitHistoryUtils.class);

private GitHistoryUtils() {
}

Expand Down Expand Up @@ -376,7 +376,7 @@ public void processTerminated(int exitCode) {
}
}
catch (Throwable t) {
LOG.error(t);
LOG.error("Error while terminating process", t);
exceptionConsumer.accept(new VcsException("Internal error " + t.getMessage(), t));
criticalFailure.set(true);
}
Expand Down Expand Up @@ -614,7 +614,9 @@ private static void processHandlerOutputByLine(
if (parseError.isNull()) {
parseError.set(t);
LOG.error(
"Could not parse \" " + StringUtil.escapeStringCharacters(builder.toString()) + "\"\n" + "Command " + handler.printableCommandLine(),
"Could not parse \"{}\"\nCommand {}",
StringEscapeUtil.escape(builder, '"'),
handler.printableCommandLine(),
t
);
}
Expand Down Expand Up @@ -731,7 +733,7 @@ private static Collection<VcsRef> parseRefs(

@Nullable
private static VcsLogObjectsFactory getObjectsFactoryWithDisposeCheck(@Nonnull Project project) {
return Application.get().runReadAction((Supplier<VcsLogObjectsFactory>) () -> {
return project.getApplication().runReadAction((Supplier<VcsLogObjectsFactory>) () -> {
if (!project.isDisposed()) {
return ServiceManager.getService(project, VcsLogObjectsFactory.class);
}
Expand Down Expand Up @@ -901,7 +903,7 @@ record -> {
for (VcsRef ref : refsInRecord) {
if (!refs.add(ref)) {
VcsRef otherRef = ContainerUtil.find(refs, r -> GitLogProvider.DONT_CONSIDER_SHA.equals(r, ref));
LOG.error("Adding duplicate element " + ref + " to the set containing " + otherRef);
LOG.error("Adding duplicate element {} to the set containing {}", ref, otherRef);
}
}
return commit;
Expand Down
Loading
Loading