{"action":"created","issue":{"url":"https://api.github.com/repos/mika/jenkins-debian-glue/issues/161","repository_url":"https://api.github.com/repos/mika/jenkins-debian-glue","labels_url":"https://api.github.com/repos/mika/jenkins-debian-glue/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/mika/jenkins-debian-glue/issues/161/comments","events_url":"https://api.github.com/repos/mika/jenkins-debian-glue/issues/161/events","html_url":"https://github.com/mika/jenkins-debian-glue/issues/161","id":180283626,"number":161,"title":"generate-git-snapshot fails if repo is detached.","user":{"login":"heftig","id":204006,"avatar_url":"https://avatars.githubusercontent.com/u/204006?v=3","gravatar_id":"","url":"https://api.github.com/users/heftig","html_url":"https://github.com/heftig","followers_url":"https://api.github.com/users/heftig/followers","following_url":"https://api.github.com/users/heftig/following{/other_user}","gists_url":"https://api.github.com/users/heftig/gists{/gist_id}","starred_url":"https://api.github.com/users/heftig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heftig/subscriptions","organizations_url":"https://api.github.com/users/heftig/orgs","repos_url":"https://api.github.com/users/heftig/repos","events_url":"https://api.github.com/users/heftig/events{/privacy}","received_events_url":"https://api.github.com/users/heftig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-30T11:40:01Z","updated_at":"2016-09-30T12:02:30Z","closed_at":null,"body":"When building with the branch specifier set to a commit ID, Jenkins detaches the HEAD and sets `GIT_BRANCH` to `detached`.\r\n\r\nThe `git checkout -f ${GIT_BRANCH}` at the end of generate-git-snapshot fails because a branch named \"detached\" does not exist."},"comment":{"url":"https://api.github.com/repos/mika/jenkins-debian-glue/issues/comments/250727582","html_url":"https://github.com/mika/jenkins-debian-glue/issues/161#issuecomment-250727582","issue_url":"https://api.github.com/repos/mika/jenkins-debian-glue/issues/161","id":250727582,"user":{"login":"heftig","id":204006,"avatar_url":"https://avatars.githubusercontent.com/u/204006?v=3","gravatar_id":"","url":"https://api.github.com/users/heftig","html_url":"https://github.com/heftig","followers_url":"https://api.github.com/users/heftig/followers","following_url":"https://api.github.com/users/heftig/following{/other_user}","gists_url":"https://api.github.com/users/heftig/gists{/gist_id}","starred_url":"https://api.github.com/users/heftig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heftig/subscriptions","organizations_url":"https://api.github.com/users/heftig/orgs","repos_url":"https://api.github.com/users/heftig/repos","events_url":"https://api.github.com/users/heftig/events{/privacy}","received_events_url":"https://api.github.com/users/heftig/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T12:02:30Z","updated_at":"2016-09-30T12:02:30Z","body":"Testing this now, will report back:\r\n\r\n```sh\r\n# switch back to previous \"branch\" before removing the tmp branch\r\nif ! git checkout -f \"${GIT_BRANCH}\"; then\r\n  # we were probably detached\r\n  git checkout -f \"${GIT_COMMIT}\"\r\nfi\r\n```\r\n"}}
{"actor":{"display_login":"heftig"}}