Skip to content

Commit f3a79c1

Browse files
committed
getFileContent() fixed to work with empty revision
1 parent c40c7d5 commit f3a79c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public String getFileContent(String branchName, String filePath, String revision
287287
ByteArrayOutputStream baos = new ByteArrayOutputStream();
288288
try {
289289
repository.getFile(new File(getBranchName(branchName), filePath).getPath().replace("\\", "/"),
290-
revision == null? -1 : Long.parseLong(revision), new SVNProperties(), baos);
290+
(revision == null || revision.isEmpty()) ? -1 : Long.parseLong(revision), new SVNProperties(), baos);
291291
return baos.toString(StandardCharsets.UTF_8.name());
292292
} catch (SVNException e) {
293293
if (e.getErrorMessage().getErrorCode().getCode() == SVN_FILE_NOT_FOUND_ERROR_CODE) {

0 commit comments

Comments
 (0)