#!/bin/bash source common.sh set -eu set -o pipefail function usage() { echo "tvlc new [-n|--name CLIENTNAME] [derivation...]" echo "" cat < "$tvlc_root/next_clientid" checkout_dir="$tvlc_root/clients/$checkout_id" mkdir "$checkout_dir" cd "$DEPOT_ROOT" git worktree add --no-checkout -b "$branch_name" "$checkout_dir" # BUG: git not creating the /info/ subdir mkdir "$DEPOT_ROOT/.git/worktrees/$checkout_id/info" cd "$checkout_dir" git sparse-checkout init --cone git sparse-checkout set "${includedPaths[@]}" ln -s "$checkout_dir" "$nice_checkout_root"/"$checkout_name" echo "$nice_checkout_root/$checkout_name"