File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/main/java/pl/project13/maven/git Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -83,12 +83,16 @@ protected String getBuildAuthorEmail() {
8383 protected void prepareGitToExtractMoreDetailedReproInformation () throws MojoExecutionException {
8484 try {
8585 // more details parsed out bellow
86- Ref HEAD = git .getRef (Constants .HEAD );
87- if (HEAD == null ) {
86+ Ref head = git .getRef (Constants .HEAD );
87+ if (head == null ) {
8888 throw new MojoExecutionException ("Could not get HEAD Ref, are you sure you've set the dotGitDirectory property of this plugin to a valid path?" );
8989 }
9090 revWalk = new RevWalk (git );
91- headCommit = revWalk .parseCommit (HEAD .getObjectId ());
91+ ObjectId headObjectId = head .getObjectId ();
92+ if (headObjectId == null ){
93+ throw new MojoExecutionException ("Could not get HEAD Ref, are you sure you've some commits in the dotGitDirectory?" );
94+ }
95+ headCommit = revWalk .parseCommit (headObjectId );
9296 revWalk .markStart (headCommit );
9397 } catch (MojoExecutionException e ) {
9498 throw e ;
You can’t perform that action at this time.
0 commit comments