This commit is contained in:
sebastien 2025-10-31 10:43:10 +01:00
parent f8afe40fa6
commit 5de3c259e6

View File

@ -193,6 +193,12 @@ export async function getFileCommitDate(
// Test
if (!output) {
console.log('NO GIT OUTPUT', file);
/*
throw new FileNotTrackedError(
`Failed to retrieve the git history for file "${file}" because the file is not tracked by git.`,
);
*/
return {
date: new Date(),
timestamp: Date.now(),
@ -203,6 +209,8 @@ export async function getFileCommitDate(
const match = output.match(regex);
if (!match) {
console.log('NO GIT MATCH', file);
return {
date: new Date(),
timestamp: Date.now(),
@ -210,6 +218,8 @@ export async function getFileCommitDate(
};
}
console.log('GIT MATCH', file, match.groups!.timestamp, match.groups!.author);
const timestampInSeconds = Number(match.groups!.timestamp);
const timestamp = timestampInSeconds * 1_000;
const date = new Date(timestamp);