File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/main/java/org/scm4j/vcs Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -676,6 +676,9 @@ private RevCommit getHeadRevCommit (String branchName) {
676676 String bn = getRealBranchName (branchName );
677677
678678 Ref ref = gitRepo .exactRef ("refs/remotes/origin/" + bn );
679+ if (ref == null ) {
680+ return null ;
681+ }
679682 ObjectId commitId = ref .getObjectId ();
680683 return rw .parseCommit ( commitId );
681684 } catch (GitAPIException e ) {
@@ -688,6 +691,9 @@ private RevCommit getHeadRevCommit (String branchName) {
688691 @ Override
689692 public VCSCommit getHeadCommit (String branchName ) {
690693 RevCommit branchHeadCommit = getHeadRevCommit (getRealBranchName (branchName ));
694+ if (branchHeadCommit == null ) {
695+ return null ;
696+ }
691697 return getVCSCommit (branchHeadCommit );
692698 }
693699
You can’t perform that action at this time.
0 commit comments