Skip to content

Commit b9675b9

Browse files
committed
setFileContent(): LWC corruption added if cmmit is failed
1 parent 2dbf251 commit b9675b9

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,17 @@ public VCSCommit setFileContent(String branchName, String filePath, String conte
312312
false, false, SVNDepth.EMPTY, false, true);
313313
}
314314

315-
SVNCommitInfo newCommit = clientManager
316-
.getCommitClient()
317-
.doCommit(new File[] { wc.getFolder() }, false, commitMessage,
318-
new SVNProperties(), null, false, false, SVNDepth.INFINITY);
319-
return newCommit == SVNCommitInfo.NULL ? VCSCommit.EMPTY :
320-
new VCSCommit(Long.toString(newCommit.getNewRevision()), commitMessage, newCommit.getAuthor());
315+
try {
316+
SVNCommitInfo newCommit = clientManager
317+
.getCommitClient()
318+
.doCommit(new File[] { wc.getFolder() }, false, commitMessage,
319+
new SVNProperties(), null, false, false, SVNDepth.INFINITY);
320+
return newCommit == SVNCommitInfo.NULL ? VCSCommit.EMPTY :
321+
new VCSCommit(Long.toString(newCommit.getNewRevision()), commitMessage, newCommit.getAuthor());
322+
} catch (SVNException e) {
323+
wc.setCorrupted(true);
324+
throw e;
325+
}
321326
}
322327
} catch (SVNException e) {
323328
throw new EVCSException(e);

0 commit comments

Comments
 (0)