]> Lady’s Gitweb - GitWikiWeb/blobdiff - build.js
Fix old recently changed files
[GitWikiWeb] / build.js
index b0df7c074b89343d93fb26373ea6cf2cbfcef966..df9c016600b3fdf9539de47d162d7ff944fc9dc9 100644 (file)
--- a/build.js
+++ b/build.js
@@ -173,7 +173,7 @@ const listOfInternalLinks = (references, wrapper = ($) => $) => ({
   ),
 });
 
   ),
 });
 
-const diffReferences = async (hash) => {
+const diffReferences = async (hash, againstHead = false) => {
   const diff = new Deno.Command("git", {
     args: [
       "diff-tree",
   const diff = new Deno.Command("git", {
     args: [
       "diff-tree",
@@ -182,7 +182,7 @@ const diffReferences = async (hash) => {
       "--name-only",
       "--no-renames",
       "--diff-filter=AM",
       "--name-only",
       "--no-renames",
       "--diff-filter=AM",
-      hash,
+      ...(againstHead ? [hash, "HEAD"] : [hash]),
     ],
     stdout: "piped",
     stderr: "piped",
     ],
     stdout: "piped",
     stderr: "piped",
@@ -692,7 +692,9 @@ class GitWikiWebPage {
           ]).then(logErrorsAndCollectResults);
           const refs = [];
           current = hash;
           ]).then(logErrorsAndCollectResults);
           const refs = [];
           current = hash;
-          for (const ref of (await diffReferences(current))) {
+          for (
+            const ref of (await diffReferences(current, !recency))
+          ) {
             if (seen.has(ref)) {
               /* do nothing */
             } else {
             if (seen.has(ref)) {
               /* do nothing */
             } else {
@@ -700,7 +702,7 @@ class GitWikiWebPage {
               seen.add(ref);
             }
           }
               seen.add(ref);
             }
           }
-          results[recency] = { dateTime, humanReadable, refs };
+          results[recency] = { dateTime, hash, humanReadable, refs };
         } while (recency-- > 0 && current && current != commit);
         return results;
       })(),
         } while (recency-- > 0 && current && current != commit);
         return results;
       })(),
This page took 0.023328 seconds and 4 git commands to generate.