From 450a0176d718a41cb37ada718346a648dda8ff70 Mon Sep 17 00:00:00 2001 From: OpherV Date: Fri, 22 May 2020 14:17:53 +0300 Subject: [PATCH] Fix #302 Unsupported Git Flow version --- src/main/java/gitflow/GitflowImpl.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/gitflow/GitflowImpl.java b/src/main/java/gitflow/GitflowImpl.java index 3456301..4651ae9 100644 --- a/src/main/java/gitflow/GitflowImpl.java +++ b/src/main/java/gitflow/GitflowImpl.java @@ -7,6 +7,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.io.File; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; @@ -493,14 +494,7 @@ public GitCommandResult trackBugfix(@NotNull GitRepository repository, @Override public GitCommandResult version(@NotNull Project project, GitLineHandlerListener... listeners) { - //getProjectFile is null for default project. - if (project.isDefault()) { - throw new IllegalArgumentException("Cannot determine git flow version for default project"); - } else { - assert project.getProjectFile() != null : "No project file for " + project; - } - - final GitLineHandler h = new GitLineHandler(project, project.getProjectFile().getParent(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(project, new File(project.getBasePath()), GitflowCommand()); h.addParameters("version");