mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[git] extract method for creating log config parameters
This commit is contained in:
@@ -265,9 +265,7 @@ public class GitLogUtil {
|
||||
boolean withChanges,
|
||||
@NotNull Consumer<GitLogRecord> converter,
|
||||
String... parameters) throws VcsException {
|
||||
List<String> configParameters = Registry.is("git.diff.renameLimit.infinity") && withChanges ?
|
||||
Collections.singletonList("diff.renameLimit=0") : Collections.emptyList();
|
||||
GitLineHandler handler = new GitLineHandler(project, root, GitCommand.LOG, configParameters);
|
||||
GitLineHandler handler = new GitLineHandler(project, root, GitCommand.LOG, createConfigParameters(withChanges));
|
||||
readRecordsFromHandler(project, root, withRefs, withChanges, converter, handler, parameters);
|
||||
}
|
||||
|
||||
@@ -356,9 +354,7 @@ public class GitLogUtil {
|
||||
commitConsumer.consume(createCommit(project, root, records, factory));
|
||||
}
|
||||
};
|
||||
List<String> configParameters = Registry.is("git.diff.renameLimit.infinity") ?
|
||||
Collections.singletonList("diff.renameLimit=0") : Collections.emptyList();
|
||||
GitLineHandler handler = new GitLineHandler(project, root, GitCommand.LOG, configParameters);
|
||||
GitLineHandler handler = new GitLineHandler(project, root, GitCommand.LOG, createConfigParameters(true));
|
||||
|
||||
Ref<Exception> inputError = new Ref<>();
|
||||
handler.setInputProcessor(stream -> {
|
||||
@@ -384,4 +380,10 @@ public class GitLogUtil {
|
||||
throw new VcsException(inputError.get());
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static List<String> createConfigParameters(boolean withChanges) {
|
||||
return Registry.is("git.diff.renameLimit.infinity") && withChanges ?
|
||||
Collections.singletonList("diff.renameLimit=0") : Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user