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) {
676
676
String bn = getRealBranchName (branchName );
677
677
678
678
Ref ref = gitRepo .exactRef ("refs/remotes/origin/" + bn );
679
+ if (ref == null ) {
680
+ return null ;
681
+ }
679
682
ObjectId commitId = ref .getObjectId ();
680
683
return rw .parseCommit ( commitId );
681
684
} catch (GitAPIException e ) {
@@ -688,6 +691,9 @@ private RevCommit getHeadRevCommit (String branchName) {
688
691
@ Override
689
692
public VCSCommit getHeadCommit (String branchName ) {
690
693
RevCommit branchHeadCommit = getHeadRevCommit (getRealBranchName (branchName ));
694
+ if (branchHeadCommit == null ) {
695
+ return null ;
696
+ }
691
697
return getVCSCommit (branchHeadCommit );
692
698
}
693
699
You can’t perform that action at this time.
0 commit comments