~ecs/tm

35286266f2ff1482b144dc68c3ff1c409a08e817 — Ember Sawady 3 years ago 0a0d142
Replace date +%s with a load of portable garbage
1 files changed, 2 insertions(+), 2 deletions(-)

M tm-commit-tree
M tm-commit-tree => tm-commit-tree +2 -2
@@ 29,8 29,8 @@ set +u
[ -z "$TM_AUTHOR" ] && abort "error: TM_AUTHOR unset"
set -u
TM_COMMITTER="${TM_COMMITTER:-$TM_AUTHOR}"
# TODO: %s isn't POSIX
TM_DATE="${TM_DATE:-$(date -u +'%s')}"
# POSIX equivalent of date -u +%s. Enjoy your nightmares
TM_DATE="${TM_DATE:-$(($(date -u +"((%Y-1600)*365+(%Y-1601)/4-(%Y-1601)/100+(%Y-1601)/400+1%j-1000-135140)*86400+(1%H-100)*3600+(1%M-100)*60+(1%S-100)")))}"
tmp="$TMPDIR/commit-tree"
printf 'commit\n' >>"$tmp"
ref="$(tm resolve-ref "$1")" || abort "error: invalid ref $1"