Пример #1
0
        internal void SetNewUsername(GitCredential entry, string username)
        {
            if (SeletedAdapter != null)
            {
                try
                {
                    if (!SeletedAdapter.SaveUsername(entry.ManagerUrl, username))
                    {
                        logger.LogFormat(LogType.Error, "Could not set new Username to {0} with URL: {1}", GetAdapterName(SeletedAdapter), entry.ManagerUrl);
                        return;
                    }
                }
                catch (Exception e)
                {
                    logger.LogFormat(LogType.Error, "There was a problem while trying to set username to {0}", GetAdapterName(SeletedAdapter));
                    logger.LogException(e);
                }
                return;
            }

            if (entry != null)
            {
                entry.SetUsername(username);
                gitCredentials.MarkDirty();
            }
        }
Пример #2
0
        internal static void SetNewUsername(string url, string user)
        {
            if (SeletedAdapter != null)
            {
                try
                {
                    if (!SeletedAdapter.SaveUsername(SeletedAdapter.FormatUrl(url), user))
                    {
                        Debug.LogErrorFormat("Could not save new Username to {0} with URL: {1}", GetAdapterName(SeletedAdapter), SeletedAdapter.FormatUrl(url));
                        return;
                    }
                }
                catch (Exception e)
                {
                    Debug.LogError("There was a problem while trying to save credentials to " + GetAdapterName(SeletedAdapter));
                    Debug.LogException(e);
                }
            }

            var entry = GitManager.GitCredentials.GetEntry(url);

            if (entry != null)
            {
                entry.SetUsername(user);
                EditorUtility.SetDirty(GitManager.GitCredentials);
                AssetDatabase.SaveAssets();
            }
        }
Пример #3
0
        internal void SetNewUsername(string url, string user)
        {
            if (SeletedAdapter != null)
            {
                try
                {
                    if (!SeletedAdapter.SaveUsername(SeletedAdapter.FormatUrl(url), user))
                    {
                        Debug.LogErrorFormat("Could not save new Username to {0} with URL: {1}", GetAdapterName(SeletedAdapter), SeletedAdapter.FormatUrl(url));
                        return;
                    }
                }
                catch (Exception e)
                {
                    Debug.LogError("There was a problem while trying to save credentials to " + GetAdapterName(SeletedAdapter));
                    Debug.LogException(e);
                }
            }

            var entry = gitCredentials.GetEntry(url);

            if (entry != null)
            {
                entry.SetUsername(user);
                gitCredentials.MarkDirty();
            }
        }