~ecs/tm

ref: 95cb618f450695312ff6849e7c6e86709e985ae9 tm/tm-init -rwxr-xr-x 430 bytes
95cb618fEmber Sawady init: use commit instead of commit-tree 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh -eu

export TM_DIR="${TM_DIR:-$PWD/.tm}"
. "$(dirname -- "$0")/lib.sh"
[ $# -ne 0 ] && abort "usage: tm init"
[ -z "${TM_AUTHOR:-}" ] && abort "error: TM_AUTHOR unset"
mkdir -p -- "$TM_DIR/objects" "$TM_DIR/refs"
[ -e "$TM_IGNORE" ] || cat <<EOF >"$TM_IGNORE"
\.tm(/.*)?$
\.git(/.*)?$
EOF
[ -e "$TM_DIR/refs/index" ] || echo "Initial commit" | tm commit
[ -e "$TM_DIR/refs/HEAD" ] || tm update-ref HEAD index >/dev/null