{"action":"created","issue":{"url":"https://api.github.com/repos/brigade/overcommit/issues/168","labels_url":"https://api.github.com/repos/brigade/overcommit/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/brigade/overcommit/issues/168/comments","events_url":"https://api.github.com/repos/brigade/overcommit/issues/168/events","html_url":"https://github.com/brigade/overcommit/issues/168","id":67162814,"number":168,"title":"Error when removing submodule","user":{"login":"lencioni","id":195534,"avatar_url":"https://avatars.githubusercontent.com/u/195534?v=3","gravatar_id":"","url":"https://api.github.com/users/lencioni","html_url":"https://github.com/lencioni","followers_url":"https://api.github.com/users/lencioni/followers","following_url":"https://api.github.com/users/lencioni/following{/other_user}","gists_url":"https://api.github.com/users/lencioni/gists{/gist_id}","starred_url":"https://api.github.com/users/lencioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lencioni/subscriptions","organizations_url":"https://api.github.com/users/lencioni/orgs","repos_url":"https://api.github.com/users/lencioni/repos","events_url":"https://api.github.com/users/lencioni/events{/privacy}","received_events_url":"https://api.github.com/users/lencioni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-08T16:02:37Z","updated_at":"2015-04-08T17:43:13Z","closed_at":null,"body":"I just ran into an interesting error when trying to make a commit that only removes a submodule. Here's what I did:\r\n\r\n```sh\r\ngit submodule deinit path/to/submodule\r\ngit rm path/to/submodule\r\nrm -rf .git/modules/path/to/submodule\r\ngit commit\r\n```\r\n\r\nThe first time I tried committing, it ran the hooks but there were errors. The second time I tried committing, I get the following output:\r\n\r\n```\r\nUnable to setup environment for pre-commit hook run:\r\nSTDOUT:\r\nSTDERR:error: path/to/submodule: is a directory - add files inside instead\r\nfatal: Unable to process path path/to/submodule\r\nCannot save the current worktree state\r\n```\r\n\r\nIf I run `git status` everything looks as I would expect.\r\n\r\nDoing this makes things work again:\r\n\r\n```sh\r\ngit reset\r\ngit add .gitmodules\r\ngit rm path/to/submodule\r\n```\r\n\r\nI'm not really sure if this is a problem with overcommit or with git, but I figured I would start here."},"comment":{"url":"https://api.github.com/repos/brigade/overcommit/issues/comments/90985193","html_url":"https://github.com/brigade/overcommit/issues/168#issuecomment-90985193","issue_url":"https://api.github.com/repos/brigade/overcommit/issues/168","id":90985193,"user":{"login":"jawshooah","id":4551271,"avatar_url":"https://avatars.githubusercontent.com/u/4551271?v=3","gravatar_id":"","url":"https://api.github.com/users/jawshooah","html_url":"https://github.com/jawshooah","followers_url":"https://api.github.com/users/jawshooah/followers","following_url":"https://api.github.com/users/jawshooah/following{/other_user}","gists_url":"https://api.github.com/users/jawshooah/gists{/gist_id}","starred_url":"https://api.github.com/users/jawshooah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jawshooah/subscriptions","organizations_url":"https://api.github.com/users/jawshooah/orgs","repos_url":"https://api.github.com/users/jawshooah/repos","events_url":"https://api.github.com/users/jawshooah/events{/privacy}","received_events_url":"https://api.github.com/users/jawshooah/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T17:43:13Z","updated_at":"2015-04-08T17:43:13Z","body":"Are you using Overcommit v0.23.0, or the latest master? This may have been fixed in #158, as I can't reproduce the error locally."}}