MCPcopy
hub / github.com/ampproject/amphtml / gitCommitFormattedTime

Function gitCommitFormattedTime

build-system/common/git.js:182–187  ·  view source on GitHub ↗

* Returns (UTC) time of a commit on the local branch, in %y%m%d%H%M%S format. * * @param {string} ref a Git reference (commit SHA, branch name, etc.) for the * commit to get the time of. * @return {string}

(ref = 'HEAD')

Source from the content-addressed store, hash-verified

180 * @return {string}
181 */
182function gitCommitFormattedTime(ref = 'HEAD') {
183 const envPrefix = process.platform == 'win32' ? 'set TZ=UTC &&' : 'TZ=UTC';
184 return getStdout(
185 `${envPrefix} git log ${ref} -1 --pretty="%cd" --date=format-local:%y%m%d%H%M%S`
186 ).trim();
187}
188
189/**
190 * Returns the merge base of the current branch off of the main branch when

Callers 1

getVersionFunction · 0.85

Calls 1

getStdoutFunction · 0.85

Tested by

no test coverage detected