#!/bin/sh
# Static GIT_ASKPASS helper for setup repository authentication.
# Credentials are passed via environment variables at call time;
# this script simply echoes them back to git.
prompt="$1"
case "$prompt" in
  *Username*|*username*)
    printf "%s\n" "${CODER_GIT_USERNAME:-x-access-token}"
    ;;
  *Password*|*password*)
    printf "%s\n" "${CODER_GIT_PASSWORD:-}"
    ;;
  *)
    printf "\n"
    ;;
esac
