I am trying to use a submodule with a global post-commit hook but find an issue.
Description
Consider we have two git directories A and B. A is the super-project of B.
Here's my script in the global post-commit hook.
#!/bin/sh
git -C path/to/A remote show origin
Expected behavior
It supposes to show the remote information about A after committing in B.
Actual behavior
It shows remote information about B after I committed in B.
Questions
- Did I do anything wrong to cause the unexpected result?
- If not, Why did this happen? (maybe caused by the limitation of post-commit hooks? doc)
- How do I get the expected behavior?