#!/bin/bash -u
#
# Copyright 2020 Misha Brukman
# SPDX-License-Identifier: Apache-2.0
# https://misha.brukman.net/blog/2020/04/add-a-repl-to-any-cli-tool/

echo "This is the Git REPL; exit via Ctrl-D."

while true; do
  echo -n "$(pwd)> git "
  read command || break

  git $command
done

# Add a blank line at the end for a clean prompt when exiting.
echo
