~ecs/tm

ref: 95cb618f450695312ff6849e7c6e86709e985ae9 tm/tm-update-ref -rwxr-xr-x 268 bytes
95cb618fEmber Sawady init: use commit instead of commit-tree 2 years ago
                                                                                
1
2
3
4
5
6
7
#!/bin/sh -eu

. "$(dirname -- "$0")/lib.sh"
[ $# -ne 2 ] && abort "usage: tm update-ref <refname> <ref>"
[ -f "$TM_DIR/refs/$1" ] || printf "creating ref %s\n" "$1"
ref="$(tm resolve-ref "$2")" || abort "error: invalid ref $2"
printf "%s\n" "$ref" >"$TM_DIR/refs/$1"