1 files changed, 4 insertions(+), 4 deletions(-)
M tm-init
M tm-init => tm-init +4 -4
@@ 5,11 5,11 @@ export TM_DIR="${TM_DIR:-$PWD/.tm}"
[ $# -ne 0 ] && abort "usage: tm init"
[ -z "${TM_AUTHOR:-}" ] && abort "error: TM_AUTHOR unset"
mkdir -p -- "$TM_DIR/objects" "$TM_DIR/refs"
-[ -e "$TM_DIR/refs/index" ] || echo "Initial commit" \
- | tm commit-tree "$(echo tree | write)" 2>/dev/null \
- >"$TM_DIR/refs/index"
-[ -e "$TM_DIR/refs/HEAD" ] || cp "$TM_DIR/refs/index" "$TM_DIR/refs/HEAD"
[ -e "$TM_IGNORE" ] || cat <<EOF >"$TM_IGNORE"
\.tm(/.*)?$
\.git(/.*)?$
EOF
+[ -e "$TM_DIR/refs/index" ] || echo "Initial commit" \
+ | tm commit-tree "$(tm insert "$TM_WS")" 2>/dev/null \
+ >"$TM_DIR/refs/index"
+[ -e "$TM_DIR/refs/HEAD" ] || tm update-ref HEAD index >/dev/null