478 B · text History 69753e1
#!/bin/sh
# gitgud-askpass — GIT_ASKPASS helper for authenticated imports.
#
# `git` invokes this with the prompt text as $1 whenever a remote asks
# for credentials. We answer from the environment so the token never
# lands in the clone URL — which would otherwise be visible in `ps` and
# persisted into the bare repo's `remote.origin.url`.
case "$1" in
Username*|username*) printf '%s' "${GITGUD_GIT_USERNAME:-}" ;;
*) printf '%s' "${GITGUD_GIT_PASSWORD:-}" ;;
esac