Skip to content

Commit

Permalink
Fix #302 Unsupported Git Flow version
Browse files Browse the repository at this point in the history
  • Loading branch information
OpherV committed May 22, 2020
1 parent 70a77bd commit 450a017
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/main/java/gitflow/GitflowImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");

Expand Down

0 comments on commit 450a017

Please sign in to comment.