Esempio n. 1
0
        internal void LoadCredentials(string url, ref string username, out SecureString password, out bool isToken, bool addEntryIfMissing)
        {
            var entry = gitCredentials.GetEntry(url);

            if (addEntryIfMissing && entry == null)
            {
                entry      = CreateEntry(url, username);
                entry.URL  = url;
                entry.Name = url;
                gitCredentials.MarkDirty();
            }
            else if (entry != null)
            {
                username = LoadUsername(entry);
                password = LoadPassword(entry);
                isToken  = entry.IsToken;
                return;
            }
            password = new SecureString();
            isToken  = false;
        }
        internal static void LoadCredentials(string url, ref string username, ref string password, bool addEntryIfMissing)
        {
            var entry = gitCredentials.GetEntry(url);

            if (addEntryIfMissing && entry == null)
            {
                entry     = CreatEntry(url, username, "");
                entry.URL = url;
                entry.SetUsername(username);
                entry.Name = url;
                gitCredentials.MarkDirty();
            }
            else if (entry != null)
            {
                username = entry.Username;
                password = LoadPassword(entry);
            }
        }