What I'm trying to achieve
I have a Git repository on the host system, which is shared with a docker container. Inside the docker container, I would like to get the files that have been changed/staged. I also want to be able to add files to be staged in the host system.
Essentially, a pre-commit hook on the host is going to call a program inside the docker image, which will then check/change files that are going to be committed.
What I've tried
From this question: git forces refresh index after switching between windows and linux
I've tried adding the GIT_INDEX_FILE argument, but at best, it results in separate staging areas, so the docker image doesn't end up working with the host's staging areas.
Without that argument, I need to run git status
in the container each time, which then refreshes the index every time.
Notes
This will likely only be running on a Mac OS X host system, and Linux docker container.