From 6ed201b709144ca1a68baed7f317400d7011999f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20de=20Giessen?= Date: Tue, 4 Jun 2019 13:21:25 +0200 Subject: [PATCH] fix($last-updated): use file author time instead of submodule commit time --- lib/prepare/util.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/prepare/util.js b/lib/prepare/util.js index 64c9b60185..579ae8fd4e 100644 --- a/lib/prepare/util.js +++ b/lib/prepare/util.js @@ -78,7 +78,11 @@ exports.encodePath = function (userpath) { exports.getGitLastUpdatedTimeStamp = function (filePath) { let lastUpdated try { - lastUpdated = parseInt(spawn.sync('git', ['log', '-1', '--format=%ct', filePath]).stdout.toString('utf-8')) * 1000 + lastUpdated = parseInt(spawn.sync( + 'git', + ['log', '-1', '--format=%ct', path.basename(filePath)], + { cwd: path.dirname(filePath) } + ).stdout.toString('utf-8')) * 1000 } catch (e) { /* do not handle for now */ } return lastUpdated }