{"action":"opened","issue":{"url":"https://api.github.com/repos/Azure/brigade/issues/228","repository_url":"https://api.github.com/repos/Azure/brigade","labels_url":"https://api.github.com/repos/Azure/brigade/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/Azure/brigade/issues/228/comments","events_url":"https://api.github.com/repos/Azure/brigade/issues/228/events","html_url":"https://github.com/Azure/brigade/issues/228","id":283365190,"number":228,"title":"vcs-sidecar fails when passed a branch name","user":{"login":"blimmer","id":630449,"avatar_url":"https://avatars1.githubusercontent.com/u/630449?v=4","gravatar_id":"","url":"https://api.github.com/users/blimmer","html_url":"https://github.com/blimmer","followers_url":"https://api.github.com/users/blimmer/followers","following_url":"https://api.github.com/users/blimmer/following{/other_user}","gists_url":"https://api.github.com/users/blimmer/gists{/gist_id}","starred_url":"https://api.github.com/users/blimmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blimmer/subscriptions","organizations_url":"https://api.github.com/users/blimmer/orgs","repos_url":"https://api.github.com/users/blimmer/repos","events_url":"https://api.github.com/users/blimmer/events{/privacy}","received_events_url":"https://api.github.com/users/blimmer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-19T20:50:18Z","updated_at":"2017-12-19T20:50:18Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I encountered this failure when trying to build a branch with brigade. I noticed that the vcs-sidecar had a familiar exception (128) and that the whole job failed because of this. Here's the output from that container:\r\n\r\n```console\r\nkubectl logs do-nothing-1513714578597-test-ecr --namespace operations vcs-sidecar\r\n+ : /src\r\n+ : git@github.com:blimmer/k8s_deploy_demo.git\r\n+ : test-ecr-pull\r\n+ git clone --depth=50 git@github.com:blimmer/k8s_deploy_demo.git /src\r\nCloning into '/src'...\r\nWarning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.\r\n+ cd /src\r\n+ git fetch origin test-ecr-pull\r\nWarning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.\r\nFrom github.com:blimmer/k8s_deploy_demo\r\n * branch            test-ecr-pull -> FETCH_HEAD\r\n+ git checkout -qf FETCH_HEAD\r\n+ git reset --hard -q test-ecr-pull\r\nfatal: ambiguous argument 'test-ecr-pull': unknown revision or path not in the working tree.\r\nUse '--' to separate paths from revisions, like this:\r\n'git <command> [<revision>...] -- [<file>...]'\r\n```\r\n\r\nThis problem occurs locally for me, too.\r\n\r\nThe solution is that, in the case of branches, you need to pass the `--branch=<branch-name>` parameter along with the `--depth` parameter. This is because the `--depth` parameter in `git` implies `--single-branch`, as well.\r\n\r\nThe tricky part is that the `--branch` parameter can only accept named tags and branches, and cannot take a commit hash, so switching logic will need to be added for this case."}}
{"actor":{"display_login":"blimmer"}}