{"action":"created","issue":{"url":"https://api.github.com/repos/conda/conda-build/issues/803","repository_url":"https://api.github.com/repos/conda/conda-build","labels_url":"https://api.github.com/repos/conda/conda-build/issues/803/labels{/name}","comments_url":"https://api.github.com/repos/conda/conda-build/issues/803/comments","events_url":"https://api.github.com/repos/conda/conda-build/issues/803/events","html_url":"https://github.com/conda/conda-build/pull/803","id":138287723,"number":803,"title":"Fix git with local branches","user":{"login":"stuarteberg","id":1655821,"avatar_url":"https://avatars.githubusercontent.com/u/1655821?v=3","gravatar_id":"","url":"https://api.github.com/users/stuarteberg","html_url":"https://github.com/stuarteberg","followers_url":"https://api.github.com/users/stuarteberg/followers","following_url":"https://api.github.com/users/stuarteberg/following{/other_user}","gists_url":"https://api.github.com/users/stuarteberg/gists{/gist_id}","starred_url":"https://api.github.com/users/stuarteberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuarteberg/subscriptions","organizations_url":"https://api.github.com/users/stuarteberg/orgs","repos_url":"https://api.github.com/users/stuarteberg/repos","events_url":"https://api.github.com/users/stuarteberg/events{/privacy}","received_events_url":"https://api.github.com/users/stuarteberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"groutr","id":10678620,"avatar_url":"https://avatars.githubusercontent.com/u/10678620?v=3","gravatar_id":"","url":"https://api.github.com/users/groutr","html_url":"https://github.com/groutr","followers_url":"https://api.github.com/users/groutr/followers","following_url":"https://api.github.com/users/groutr/following{/other_user}","gists_url":"https://api.github.com/users/groutr/gists{/gist_id}","starred_url":"https://api.github.com/users/groutr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groutr/subscriptions","organizations_url":"https://api.github.com/users/groutr/orgs","repos_url":"https://api.github.com/users/groutr/repos","events_url":"https://api.github.com/users/groutr/events{/privacy}","received_events_url":"https://api.github.com/users/groutr/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2016-03-03T20:24:32Z","updated_at":"2016-03-08T04:08:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/conda/conda-build/pulls/803","html_url":"https://github.com/conda/conda-build/pull/803","diff_url":"https://github.com/conda/conda-build/pull/803.diff","patch_url":"https://github.com/conda/conda-build/pull/803.patch"},"body":"This PR addresses an issue that can occur when building a conda recipe from a local git repository. For example:\r\n\r\n```yaml\r\nsource:\r\n  git_url: ../\r\n```\r\n\r\nIf the user *switches branches* and attempts to build a recipe, conda-build's `git_cache` will still point to the old `HEAD`, meaning that the user is not building the branch she thinks she's building.\r\n\r\nFor example:\r\n\r\n```bash\r\ncd my-git-repo\r\ngit checkout master\r\n\r\n# This clones my-git-repo to the cache, and sets HEAD to 'master'\r\nconda build my-conda-recipe\r\n\r\n# Switch branches\r\ngit checkout develop\r\n\r\n# This updates my-git-repo via 'git fetch', but HEAD is still 'master'.\r\n# Oops! We're just re-building the 'master' recipe, not 'develop'.\r\nconda build my-conda-recipe \r\n```\r\n\r\nIt's surprising that this hasn't been noticed before, but maybe most people use `source/path` instead of `source/git_url` for local repositories, so this problem doesn't affect them.\r\n\r\nAside from that issue, I'm fixing a few other git-related problems.  See the commit history for details."},"comment":{"url":"https://api.github.com/repos/conda/conda-build/issues/comments/193595247","html_url":"https://github.com/conda/conda-build/pull/803#issuecomment-193595247","issue_url":"https://api.github.com/repos/conda/conda-build/issues/803","id":193595247,"user":{"login":"stuarteberg","id":1655821,"avatar_url":"https://avatars.githubusercontent.com/u/1655821?v=3","gravatar_id":"","url":"https://api.github.com/users/stuarteberg","html_url":"https://github.com/stuarteberg","followers_url":"https://api.github.com/users/stuarteberg/followers","following_url":"https://api.github.com/users/stuarteberg/following{/other_user}","gists_url":"https://api.github.com/users/stuarteberg/gists{/gist_id}","starred_url":"https://api.github.com/users/stuarteberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuarteberg/subscriptions","organizations_url":"https://api.github.com/users/stuarteberg/orgs","repos_url":"https://api.github.com/users/stuarteberg/repos","events_url":"https://api.github.com/users/stuarteberg/events{/privacy}","received_events_url":"https://api.github.com/users/stuarteberg/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T04:08:49Z","updated_at":"2016-03-08T04:08:49Z","body":"Sigh.  Not sure what's going on with the tests.  They were working before, and they still pass on my machine..."}}