Git includes a set of tests for credential helpers https://github.com/git/git/blob/master/t/t0303-credential-external.sh
This is a tool for authors of external helper tools to sanity-check their helpers.
I tried to test GCM with cache store choosing appropriate non-interactive options:
GIT_TEST_CREDENTIAL_HELPER=manager GCM_CREDENTIAL_STORE=cache GCM_GUI_PROMPT=0 GCM_INTERACTIVE=never GCM_AUTODETECT_TIMEOUT=0 ./t0303-credential-external.sh -v
15 of 21 tests fail.
10 tests fail because GCM prints an unexpected line to stderr "Cannot prompt because user interactivity has been disabled.". t0303-credential-external.sh assumes that a helper exits silently status 0 if it can't find a credential. This is the behaviour of other helpers including credential-cache and credential-store.
5 tests fail for various more interesting reasons.
If possible, it would be nice to change GCM to exit silently status 0 like other helpers. Alternatively, define a GCM_SILENT_EXIT option with this behaviour.