{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/483","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/483/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/483/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/483/events","html_url":"https://github.com/spring-cloud/spring-cloud-config/pull/483","id":172327120,"number":483,"title":"Handle Git Environment Repository updated from a forced push.","user":{"login":"daniellavoie","id":4403970,"avatar_url":"https://avatars.githubusercontent.com/u/4403970?v=3","gravatar_id":"","url":"https://api.github.com/users/daniellavoie","html_url":"https://github.com/daniellavoie","followers_url":"https://api.github.com/users/daniellavoie/followers","following_url":"https://api.github.com/users/daniellavoie/following{/other_user}","gists_url":"https://api.github.com/users/daniellavoie/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellavoie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellavoie/subscriptions","organizations_url":"https://api.github.com/users/daniellavoie/orgs","repos_url":"https://api.github.com/users/daniellavoie/repos","events_url":"https://api.github.com/users/daniellavoie/events{/privacy}","received_events_url":"https://api.github.com/users/daniellavoie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-08-21T15:52:21Z","updated_at":"2016-08-24T13:59:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/pulls/483","html_url":"https://github.com/spring-cloud/spring-cloud-config/pull/483","diff_url":"https://github.com/spring-cloud/spring-cloud-config/pull/483.diff","patch_url":"https://github.com/spring-cloud/spring-cloud-config/pull/483.patch"},"body":"Fixes gh-481.\r\n\r\nThe unit test might not seem obvious so feel free to ask about it. If you want to fully understand the reason behind this PR, checkout my branch, revert the `JGitEnvironmentRepository` changes I made and run the `JGitEnvironmentRepositoryIntegrationTests.pullDivergedRepo()` test. You will see that the local repositroy will be left in a conflicting state. It represents the issue I encountered in production. \r\n\r\nIn order to fix this issue, I changed the `git pull` operation performed by `JGitEnvironmentRepository` to a `git fetch` then `git reset --hard`. IMO, hard is reset is acceptable since the local repository should not be modified."},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/comments/242074147","html_url":"https://github.com/spring-cloud/spring-cloud-config/pull/483#issuecomment-242074147","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/483","id":242074147,"user":{"login":"ryanjbaxter","id":524254,"avatar_url":"https://avatars.githubusercontent.com/u/524254?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanjbaxter","html_url":"https://github.com/ryanjbaxter","followers_url":"https://api.github.com/users/ryanjbaxter/followers","following_url":"https://api.github.com/users/ryanjbaxter/following{/other_user}","gists_url":"https://api.github.com/users/ryanjbaxter/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanjbaxter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanjbaxter/subscriptions","organizations_url":"https://api.github.com/users/ryanjbaxter/orgs","repos_url":"https://api.github.com/users/ryanjbaxter/repos","events_url":"https://api.github.com/users/ryanjbaxter/events{/privacy}","received_events_url":"https://api.github.com/users/ryanjbaxter/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T13:59:26Z","updated_at":"2016-08-24T13:59:26Z","body":"👍 LGTM"}}
{"actor":{"display_login":"ryanjbaxter"}}