#!/bin/bash # # Hook script to restore metadata information using metastore # following each checkout. # Do not restore metadata on a checkout from index if [ "$3" -eq 0 ] then exit 0 fi STOREFILE=".metadata/$(git symbolic-ref HEAD)/.metadata" if [ ! -e "$STOREFILE" ]; then echo "No .metadata yet" >&2 exit 0 fi if ! metastore -q -a -f "$STOREFILE"; then echo "Failed to execute metastore -a" >&2 exit 1 fi exit 0