#!/usr/bin/env bash
# Snapshot the working tree (tracked + untracked, not ignored) into a private index
# file. No commit is created and the real index is untouched (CLAUDE.md: no commits).
# Usage: wt-snapshot OUT_INDEX
set -euo pipefail
out=$1
cp "$(git rev-parse --git-dir)/index" "$out"
GIT_INDEX_FILE="$out" git add -A 2>/dev/null
echo "snapshot: $out"
