{"action":"created","issue":{"url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/319","labels_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/319/comments","events_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/319/events","html_url":"https://github.com/gitpython-developers/GitPython/pull/319","id":95743439,"number":319,"title":"Always add '--' to git reset","user":{"login":"jeblair","id":899068,"avatar_url":"https://avatars.githubusercontent.com/u/899068?v=3","gravatar_id":"","url":"https://api.github.com/users/jeblair","html_url":"https://github.com/jeblair","followers_url":"https://api.github.com/users/jeblair/followers","following_url":"https://api.github.com/users/jeblair/following{/other_user}","gists_url":"https://api.github.com/users/jeblair/gists{/gist_id}","starred_url":"https://api.github.com/users/jeblair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeblair/subscriptions","organizations_url":"https://api.github.com/users/jeblair/orgs","repos_url":"https://api.github.com/users/jeblair/repos","events_url":"https://api.github.com/users/jeblair/events{/privacy}","received_events_url":"https://api.github.com/users/jeblair/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-17T20:57:08Z","updated_at":"2015-07-18T08:13:45Z","closed_at":"2015-07-18T08:12:42Z","pull_request":{"url":"https://api.github.com/repos/gitpython-developers/GitPython/pulls/319","html_url":"https://github.com/gitpython-developers/GitPython/pull/319","diff_url":"https://github.com/gitpython-developers/GitPython/pull/319.diff","patch_url":"https://github.com/gitpython-developers/GitPython/pull/319.patch"},"body":"If a git repo has the misfortune to have a file with the name \"HEAD\"\r\nat the root level of the repo, git will return an error because it\r\nis unsure whether the file or ref is meant:\r\n\r\n    File \"/usr/local/lib/python2.7/dist-packages/git/refs/head.py\", line 81, in reset\r\n      self.repo.git.reset(mode, commit, add_arg, paths, **kwargs)\r\n    File \"/usr/local/lib/python2.7/dist-packages/git/cmd.py\", line 440, in <lambda>\r\n      return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)\r\n    File \"/usr/local/lib/python2.7/dist-packages/git/cmd.py\", line 834, in _call_process\r\n      return self.execute(make_call(), **_kwargs)\r\n    File \"/usr/local/lib/python2.7/dist-packages/git/cmd.py\", line 627, in execute\r\n      raise GitCommandError(command, status, stderr_value)\r\n  GitCommandError: 'git reset --hard HEAD' returned with exit code 128\r\n  stderr: 'fatal: ambiguous argument 'HEAD': both revision and filename\r\n  Use '--' to separate filenames from revisions'\r\n\r\nImplement its suggested fix by always passing '--' as an argument to\r\n\"git reset\".  It is fine to pass it with no file specifiers afterwords.\r\nIn that case, git knows that \"HEAD\" is always meant as the ref."},"comment":{"url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/comments/122511179","html_url":"https://github.com/gitpython-developers/GitPython/pull/319#issuecomment-122511179","issue_url":"https://api.github.com/repos/gitpython-developers/GitPython/issues/319","id":122511179,"user":{"login":"Byron","id":63622,"avatar_url":"https://avatars.githubusercontent.com/u/63622?v=3","gravatar_id":"","url":"https://api.github.com/users/Byron","html_url":"https://github.com/Byron","followers_url":"https://api.github.com/users/Byron/followers","following_url":"https://api.github.com/users/Byron/following{/other_user}","gists_url":"https://api.github.com/users/Byron/gists{/gist_id}","starred_url":"https://api.github.com/users/Byron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Byron/subscriptions","organizations_url":"https://api.github.com/users/Byron/orgs","repos_url":"https://api.github.com/users/Byron/repos","events_url":"https://api.github.com/users/Byron/events{/privacy}","received_events_url":"https://api.github.com/users/Byron/received_events","type":"User","site_admin":false},"created_at":"2015-07-18T08:13:45Z","updated_at":"2015-07-18T08:13:45Z","body":"Thank you ! This one was a subtle bug indeed !"}}