#!/bin/sh

# Exit immediately when a command fails.
set -e

remote="$1"
url="$2"

# Unset GIT_DIR. Git does not set GIT_DIR for pre-push hooks, but anyway an existing GIT_DIR variable
# confuses child git processes (especially ones operating on other repos).
unset GIT_DIR

# This program checks casing of ref names being pushed.
# It reads all lines from stdin.

if [[ -f .git/hooks/PushChecker.exe ]]; then
    .git/hooks/PushChecker.exe --git "`which git`" $remote $url
fi

# this script uploads exstorage caches.

git exstorage upload
