[git] extract method for --no-walk parameter

This commit is contained in:
Julia Beliaeva
2017-06-16 19:16:37 +03:00
parent 18fdfcafcc
commit 4e3757ff0e
2 changed files with 7 additions and 4 deletions

View File

@@ -614,8 +614,7 @@ public class GitHistoryUtils {
public static String[] formHashParameters(@NotNull GitVcs vcs, @NotNull Collection<String> hashes) {
List<String> parameters = ContainerUtil.newArrayList();
String noWalk = GitVersionSpecialty.NO_WALK_UNSORTED.existsIn(vcs.getVersion()) ? "--no-walk=unsorted" : "--no-walk";
parameters.add(noWalk);
parameters.add(GitLogUtil.getNoWalkParameter(vcs));
parameters.addAll(hashes);
return ArrayUtil.toStringArray(parameters);

View File

@@ -372,8 +372,7 @@ public class GitLogUtil {
return false;
});
readRecordsFromHandler(project, root, false, true, recordCollector, handler,
GitVersionSpecialty.NO_WALK_UNSORTED.existsIn(vcs.getVersion()) ? "--no-walk=unsorted" : "--no-walk", "--stdin");
readRecordsFromHandler(project, root, false, true, recordCollector, handler, getNoWalkParameter(vcs), "--stdin");
recordCollector.finish();
if (!inputError.isNull()) {
@@ -381,6 +380,11 @@ public class GitLogUtil {
}
}
@NotNull
public static String getNoWalkParameter(@NotNull GitVcs vcs) {
return GitVersionSpecialty.NO_WALK_UNSORTED.existsIn(vcs.getVersion()) ? "--no-walk=unsorted" : "--no-walk";
}
@NotNull
private static List<String> createConfigParameters(boolean withChanges) {
return Registry.is("git.diff.renameLimit.infinity") && withChanges ?