#!/usr/bin/env bash # Recursively dump all blobs in the subtree identified by ID. set -o pipefail usage() { cat <&2 exit 1 ;; esac } case $# in 1) ;; 3) if test "$1" != --git-dir; then usage 1>&2 exit 1 fi export GIT_DIR="$2" shift 2 ;; *) usage 1>&2 exit 1 ;; esac top="$1" type=$(git cat-file -t "$top") || exit $? cat-item "$top" "$type"