Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2From: Guanran Wang <guanran928@outlook.com> 3Date: Tue, 9 Jul 2024 16:49:41 +0800 4Subject: [PATCH] fix git hash 5 6--- 7 lib/utils/git-hash.ts | 12 ++---------- 8 1 file changed, 2 insertions(+), 10 deletions(-) 9 10diff --git a/lib/utils/git-hash.ts b/lib/utils/git-hash.ts 11index 9a8131696..f1f568fb4 100644 12--- a/lib/utils/git-hash.ts 13+++ b/lib/utils/git-hash.ts 14@@ -1,14 +1,6 @@ 15 import { execSync } from 'child_process'; 16 17-let gitHash = process.env.HEROKU_SLUG_COMMIT?.slice(0, 8) || process.env.VERCEL_GIT_COMMIT_SHA?.slice(0, 8); 18-let gitDate: Date | undefined; 19-if (!gitHash) { 20- try { 21- gitHash = execSync('git rev-parse HEAD').toString().trim().slice(0, 8); 22- gitDate = new Date(execSync('git log -1 --format=%cd').toString().trim()); 23- } catch { 24- gitHash = 'unknown'; 25- } 26-} 27+let gitHash = '@GIT_HASH@'.slice(0, 8); 28+let gitDate = new Date('Thu Jan 1 00:00:00 1970 +0000'); 29 30 export { gitHash, gitDate };