Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/main/java/pl/project13/maven/git/JGitProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ protected String getBuildAuthorEmail() {
protected void prepareGitToExtractMoreDetailedReproInformation() throws MojoExecutionException {
try {
// more details parsed out bellow
Ref HEAD = git.getRef(Constants.HEAD);
if (HEAD == null) {
throw new MojoExecutionException("Could not get HEAD Ref, are you sure you've set the dotGitDirectory property of this plugin to a valid path?");
Ref head = git.getRef(Constants.HEAD);
if (head == null) {
throw new MojoExecutionException("Could not get HEAD Ref, are you sure you have set the dotGitDirectory property of this plugin to a valid path?");
}
revWalk = new RevWalk(git);
headCommit = revWalk.parseCommit(HEAD.getObjectId());
ObjectId headObjectId = head.getObjectId();
if(headObjectId == null){
throw new MojoExecutionException("Could not get HEAD Ref, are you sure you have some commits in the dotGitDirectory?");
}
headCommit = revWalk.parseCommit(headObjectId);
revWalk.markStart(headCommit);
} catch (MojoExecutionException e) {
throw e;
Expand Down