Skip to content

Commit 1117899

Browse files
committed
getHeadCommit() returns null if branch does not exists
1 parent 6dc9e9c commit 1117899

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/org/scm4j/vcs/svn/SVNVCS.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,9 @@ public VCSCommit getHeadCommit(String branchName) {
584584
SVNLogEntry headEntry = getDirHeadLogEntry(getBranchName(branchName));
585585
return new VCSCommit(Long.toString(headEntry.getRevision()), headEntry.getMessage(), headEntry.getAuthor());
586586
} catch (SVNException e) {
587+
if (e.getErrorMessage().getErrorCode().getCode() == SVN_FILE_NOT_FOUND_ERROR_CODE) {
588+
return null;
589+
}
587590
throw new EVCSException(e);
588591
} catch (Exception e) {
589592
throw new RuntimeException(e);

0 commit comments

Comments
 (0)