From 82eb249853868582d8ba65e3afc5a7dcaeb620ea Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Thu, 20 Feb 2020 02:24:12 +0000 Subject: credential: use the last matching username in the config Everywhere else in the codebase, we use the rule that the last matching configuration option is the one that takes effect. This is helpful because it allows more specific configuration settings (e.g., per-repo configuration) to override less specific settings (e.g., per-user configuration). However, in the credential code, we didn't honor this setting, and instead picked the first setting we had, and stuck with it. This was likely to ensure we picked the value from the URL, which we want to honor over the configuration. It's possible to do both, though, so let's check if the value is the one we've gotten over our protocol connection, which if present will have come from the URL, and keep it if so. Otherwise, let's overwrite the value with the latest version we've got from the configuration, so we keep the last configuration value. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- credential.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'credential.h') diff --git a/credential.h b/credential.h index 5772d50577..fffed4d934 100644 --- a/credential.h +++ b/credential.h @@ -208,7 +208,8 @@ struct credential { unsigned approved:1, configured:1, quit:1, - use_http_path:1; + use_http_path:1, + username_from_proto:1; char *username; char *password; -- cgit v1.2.3