* 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')
| 180 | * @return {string} |
| 181 | */ |
| 182 | function 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 |
no test coverage detected