{"action":"opened","issue":{"url":"https://api.github.com/repos/bndtools/bnd/issues/805","labels_url":"https://api.github.com/repos/bndtools/bnd/issues/805/labels{/name}","comments_url":"https://api.github.com/repos/bndtools/bnd/issues/805/comments","events_url":"https://api.github.com/repos/bndtools/bnd/issues/805/events","html_url":"https://github.com/bndtools/bnd/issues/805","id":57736180,"number":805,"title":"aQute.bnd.osgi.Builder._githead(String[] args) is broken","user":{"login":"bjhargrave","id":277682,"avatar_url":"https://avatars.githubusercontent.com/u/277682?v=3","gravatar_id":"","url":"https://api.github.com/users/bjhargrave","html_url":"https://github.com/bjhargrave","followers_url":"https://api.github.com/users/bjhargrave/followers","following_url":"https://api.github.com/users/bjhargrave/following{/other_user}","gists_url":"https://api.github.com/users/bjhargrave/gists{/gist_id}","starred_url":"https://api.github.com/users/bjhargrave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjhargrave/subscriptions","organizations_url":"https://api.github.com/users/bjhargrave/orgs","repos_url":"https://api.github.com/users/bjhargrave/repos","events_url":"https://api.github.com/users/bjhargrave/events{/privacy}","received_events_url":"https://api.github.com/users/bjhargrave/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-15T16:38:37Z","updated_at":"2015-02-15T16:38:37Z","closed_at":null,"body":"The biz.aQute.bndlib.test `test.BuilderTest.testGitHead()` method started failing on my system. I spent some time trying to figure out why. Eventually I created a branch to hack on the code to figure it out and then the test magically started working again! \r\n\r\nIt turns out the reason it stopped working was that I had recently ran `git gc` on my local repo which packed the refs into `.git/packed-refs` so there was no longer a loose ref for master at `.git/refs/heads/master`. \r\n\r\nThe implementation of `_githead` completely ignores packed-refs and so will start failing after a gc. `_githead` assumes it knows the on-disk structure of a git repo, but it does not fully. See <https://git-htmldocs.googlecode.com/git/git-pack-refs.html>."}}