{"action":"closed","issue":{"url":"https://api.github.com/repos/retailcoder/Rubberduck/issues/470","labels_url":"https://api.github.com/repos/retailcoder/Rubberduck/issues/470/labels{/name}","comments_url":"https://api.github.com/repos/retailcoder/Rubberduck/issues/470/comments","events_url":"https://api.github.com/repos/retailcoder/Rubberduck/issues/470/events","html_url":"https://github.com/retailcoder/Rubberduck/issues/470","id":76523137,"number":470,"title":"Loading the SourceControl Window tries to check out the branch several times","user":{"login":"ckuhn203","id":2716800,"avatar_url":"https://avatars.githubusercontent.com/u/2716800?v=3","gravatar_id":"","url":"https://api.github.com/users/ckuhn203","html_url":"https://github.com/ckuhn203","followers_url":"https://api.github.com/users/ckuhn203/followers","following_url":"https://api.github.com/users/ckuhn203/following{/other_user}","gists_url":"https://api.github.com/users/ckuhn203/gists{/gist_id}","starred_url":"https://api.github.com/users/ckuhn203/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckuhn203/subscriptions","organizations_url":"https://api.github.com/users/ckuhn203/orgs","repos_url":"https://api.github.com/users/ckuhn203/repos","events_url":"https://api.github.com/users/ckuhn203/events{/privacy}","received_events_url":"https://api.github.com/users/ckuhn203/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/retailcoder/Rubberduck/labels/source-control-integration","name":"source-control-integration","color":"DDDDDd"}],"state":"closed","locked":false,"assignee":{"login":"ckuhn203","id":2716800,"avatar_url":"https://avatars.githubusercontent.com/u/2716800?v=3","gravatar_id":"","url":"https://api.github.com/users/ckuhn203","html_url":"https://github.com/ckuhn203","followers_url":"https://api.github.com/users/ckuhn203/followers","following_url":"https://api.github.com/users/ckuhn203/following{/other_user}","gists_url":"https://api.github.com/users/ckuhn203/gists{/gist_id}","starred_url":"https://api.github.com/users/ckuhn203/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckuhn203/subscriptions","organizations_url":"https://api.github.com/users/ckuhn203/orgs","repos_url":"https://api.github.com/users/ckuhn203/repos","events_url":"https://api.github.com/users/ckuhn203/events{/privacy}","received_events_url":"https://api.github.com/users/ckuhn203/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-05-14T23:22:46Z","updated_at":"2015-05-16T22:04:31Z","closed_at":"2015-05-16T22:04:31Z","body":"In `BranchesPresenter` these two lines of code both innocently enough change the selected index of the combo box.\r\n\r\n        public void RefreshView()\r\n        {\r\n            _view.Local = this.Provider.Branches.Where(b => !b.IsRemote).Select(b => b.Name).ToList();\r\n            _view.Current = this.Provider.CurrentBranch.Name;\r\n\r\nThat in turn triggers the `BranchesControl.OnSelectedBranchChanged` event to fire, which *in turn* tells the `BranchesPresenter` to check out the current branch.\r\n\r\n        private void OnSelectedBranchChanged(object sender, EventArgs e)\r\n        {\r\n            try\r\n            {\r\n                this.Provider.Checkout(_view.Current);\r\n            }\r\n\r\nStop this behavior from occurring until after the window has loaded. Minimally, make sure that this occurs once and only once."}}