code: func (ctxt *CredentialHelperContext) GetCredentialHelper(helper CredentialHelper, u *url.URL) (CredentialHelper, Creds) {
  	rawurl := fmt.Sprintf("%s://%s%s", u.Scheme, u.Host, u.Path)
  	input := Creds{"protocol": u.Scheme, "host": u.Host}
  	if u.User != nil && u.User.Username() != "" {
  		input["username"] = u.User.Username()
  	}
  	if u.Scheme == "cert" || ctxt.urlConfig.Bool("credential", rawurl, "usehttppath", false) {
  		input["path"] = strings.TrimPrefix(u.Path, "/")
  	}
  
  	if helper != nil {
  		return helper, input
  	}
  
  	helpers := make([]CredentialHelper, 0, 4)
  	if ctxt.netrcCredHelper != nil {
  		helpers = append(helpers, ctxt.netrcCredHelper)
  	}
  	if ctxt.cachingCredHelper != nil {
  		helpers = append(helpers, ctxt.cachingCredHelper)
  	}
  	if ctxt.askpassCredHelper != nil {
  		helper, _ := ctxt.urlConfig.Get("credential", rawurl, "helper")
  		if len(helper) == 0 {
  			helpers = append(helpers, ctxt.askpassCredHelper)
  		}
  	}
  
  	return NewCredentialHelpers(append(helpers, ctxt.commandCredHelper)), input
  }
docs: // getCredentialHelper parses a 'credsConfig' from the git and OS environments,
  // returning the appropriate CredentialHelper to authenticate requests with.
  //
  // It returns an error if any configuration was invalid, or otherwise
  // un-useable.