Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'credential.c')
-rw-r--r--credential.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/credential.c b/credential.c
index 023b59d571..8825c6f132 100644
--- a/credential.c
+++ b/credential.c
@@ -33,13 +33,14 @@ void credential_clear(struct credential *c)
}
int credential_match(const struct credential *want,
- const struct credential *have)
+ const struct credential *have, int match_password)
{
#define CHECK(x) (!want->x || (have->x && !strcmp(want->x, have->x)))
return CHECK(protocol) &&
CHECK(host) &&
CHECK(path) &&
- CHECK(username);
+ CHECK(username) &&
+ (!match_password || CHECK(password));
#undef CHECK
}
@@ -102,7 +103,7 @@ static int match_partial_url(const char *url, void *cb)
warning(_("skipping credential lookup for key: credential.%s"),
url);
else
- matches = credential_match(&want, c);
+ matches = credential_match(&want, c, 0);
credential_clear(&want);
return matches;