From: David ‘Bombe’ Roden Date: Sat, 17 Mar 2012 13:06:48 +0000 (+0100) Subject: Always set the current hash when inserting. X-Git-Tag: 0.10-rc1~27 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=676508d76c058279be144efdc58ae6d7a34db783;p=jSite.git Always set the current hash when inserting. --- diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index f447eed..158a0bb 100644 --- a/src/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/de/todesbaum/jsite/application/ProjectInserter.java @@ -280,13 +280,13 @@ public class ProjectInserter implements FileScannerListener, Runnable { String filename = file.getFilename(); FileOption fileOption = project.getFileOption(filename); if (fileOption.isInsert()) { + fileOption.setCurrentHash(file.getHash()); /* check if file was modified. */ if (file.getHash().equals(fileOption.getLastInsertHash())) { /* only insert a redirect. */ logger.log(Level.FINE, String.format("Inserting redirect to edition %d for %s.", fileOption.getLastInsertEdition(), filename)); return new RedirectFileEntry(filename, fileOption.getMimeType(), "SSK@" + project.getRequestURI() + "/" + project.getPath() + "-" + fileOption.getLastInsertEdition() + "/" + filename); } - fileOption.setCurrentHash(file.getHash()); try { long[] fileLength = new long[1]; InputStream fileEntryInputStream = createFileInputStream(filename, fileOption, edition, fileLength);