git pre-commit script calls git clone and fails
A code base I have as part of its functionality runs git commands to check in code to a outside git repo. For this code base, it has its own git repo with a pre-commit script that runs a check that tests the code being committed. A problem is that when ever the pre-commit runs the code base to test the ou开发者_高级运维tside git command functionality it causes the code base git commit to fail with the error:
error: invalid object 8e2c01bddee6ee312651e076d6c1bd296888129f
error: Error building trees
This works fine if I remove the git functionality tests from the pre-commit. I have tried git options work-tree and git-dir, forking the process, separate process, it seems to be dependent on if the git functionality tests are run as any part of when the code base git commit is run. Is there anything else I can try, or is this a lost cause?
There is a git-dir parameter you can add to git commands that will in effect change where the git command is run.
精彩评论