mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
@NotNull, @Nullable
This commit is contained in:
@@ -483,6 +483,10 @@ public class GitVcs extends AbstractVcs<CommittedChangeList> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the version number of Git, which is used by IDEA. <code>null</code> can be returned if the GitVcs hasn't yet activated.
|
||||
*/
|
||||
@Nullable
|
||||
public GitVersion getVersion() {
|
||||
return myVersion;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
@@ -82,6 +83,7 @@ public final class GitVersion implements Comparable<GitVersion> {
|
||||
/**
|
||||
* Parses output of "git version" command.
|
||||
*/
|
||||
@NotNull
|
||||
public static GitVersion parse(String output) throws ParseException {
|
||||
if (StringUtil.isEmptyOrSpaces(output)) {
|
||||
throw new ParseException("Empty git --version output: " + output, 0);
|
||||
@@ -117,6 +119,7 @@ public final class GitVersion implements Comparable<GitVersion> {
|
||||
return Integer.parseInt(match);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static GitVersion identifyVersion(String gitExecutable) throws TimeoutException, ExecutionException, ParseException {
|
||||
GeneralCommandLine commandLine = new GeneralCommandLine();
|
||||
commandLine.setExePath(gitExecutable);
|
||||
|
||||
Reference in New Issue
Block a user