@NotNull, @Nullable

This commit is contained in:
Kirill Likhodedov
2011-07-26 10:49:58 +04:00
parent 274d95001c
commit 32edddfd8a
2 changed files with 7 additions and 0 deletions
@@ -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);