diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2012-03-12 19:09:24 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2012-03-12 19:09:24 +0400 |
commit | 493b2ae9e0f52972fe6c7b71d8060ba41699fb37 (patch) | |
tree | cf4795e35de01a602be1f6039c87453289e7f643 /main/src/addins/VersionControl | |
parent | 79af4422664243836f400ff67513b0e2b27c9f1b (diff) | |
parent | 23ddc59cc5c7b4b631983ef8fd6d3913320286c9 (diff) |
Merge branch 'master' into newresolver
Diffstat (limited to 'main/src/addins/VersionControl')
-rw-r--r-- | main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs index 525c0d2610..a3f1e5d0f4 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs @@ -35,7 +35,7 @@ namespace MonoDevelop.VersionControl.Git { public class GitCredentials: CredentialsProvider { - DateTime LastAsked { + bool HasReset { get; set; } @@ -60,8 +60,7 @@ namespace MonoDevelop.VersionControl.Git if (TryGetUsernamePassword (uri, items, out passwordItem) || TryGetPassphrase (uri, items, out passphraseItem)) { // If the password store has a password and we already tried using it, it could be incorrect. // If this happens, do not return true and ask the user for a new password. - if (!ProbablyIncorrect ()) { - LastAsked = DateTime.Now; + if (!HasReset) { return true; } } @@ -75,7 +74,7 @@ namespace MonoDevelop.VersionControl.Git } }); - LastAsked = DateTime.Now; + HasReset = false; if (result) { if (passwordItem != null) { PasswordService.AddWebPassword (new Uri (uri.ToString ()), new string (passwordItem.GetValue ())); @@ -86,11 +85,9 @@ namespace MonoDevelop.VersionControl.Git return result; } - bool ProbablyIncorrect () + public override void Reset (URIish uri) { - // If we are queried multiple times in rapid succession it is probably - // because the supplied password is incorrect and we should dump it. - return (DateTime.Now - LastAsked) < TimeSpan.FromSeconds (2); + HasReset = true; } bool TryGetPassphrase (URIish uri, CredentialItem[] items, out CredentialItem.StringType passphraseItem) |