-
Notifications
You must be signed in to change notification settings - Fork 280
Closed
Description
I just ran into an interesting error when trying to make a commit that only removes a submodule. Here's what I did:
git submodule deinit path/to/submodule
git rm path/to/submodule
rm -rf .git/modules/path/to/submodule
git commitThe first time I tried committing, it ran the hooks but there were errors. The second time I tried committing, I get the following output:
Unable to setup environment for pre-commit hook run:
STDOUT:
STDERR:error: path/to/submodule: is a directory - add files inside instead
fatal: Unable to process path path/to/submodule
Cannot save the current worktree state
If I run git status everything looks as I would expect.
Doing this makes things work again:
git reset
git add .gitmodules
git rm path/to/submoduleI'm not really sure if this is a problem with overcommit or with git, but I figured I would start here.