Skip to content

Commit

Permalink
fix git stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jan 6, 2024
1 parent 13174f7 commit 0988305
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function dateFromGitLog(fs, filename, timeType) {
'--format=%cd',
'--date=unix',
'--name-only',
...(timeType === 'ctimeMs' ? ['--diff-filter=A'] : ['--max-count=1']),
...(timeType === 'ctimeMs' ? ['--diff-filter=A'] : ['--diff-filter=AM']),
]);
const numberRE = /^\d+$/;
const lines = result.stdout.split('\n');
Expand All @@ -31,7 +31,8 @@ async function dateFromGitLog(fs, filename, timeType) {
currentDate = new Date(seconds * 1000);
}
} else if (line.length > 2) {
mapInfo.map.set(line.trim(), currentDate);
const filename = line.trim();
mapInfo.map.set(filename, mapInfo.map.get(filename) || currentDate);
}
}
}
Expand All @@ -40,7 +41,7 @@ async function dateFromGitLog(fs, filename, timeType) {
return date;
}
const stat = fs.statSync(filename);
console.log('got date from filename:', stat[timeType]);
console.log('got date', stat[timeType], 'from filename:', filename);
return new Date(stat[timeType]);
}

Expand Down

0 comments on commit 0988305

Please sign in to comment.