Hi,
I have not tried/verified yet, but this sounds suspiciously like the issues discussed in:
- BitBucket ContentService is unable to stream file content or directory info (Developer community question)
- BitBucket ContentService is unable to stream file content or directory info (general community question)
Both are pointing to BSERV-10437: Pre-receive hooks can only read objects from the repository being pushed to on Git 2.11+ as the underlying bug/issue.
NOTE: BSERV-10437 is supposed to be fixed in 5.7.0, i.e. your tests with 5.7 should have worked then, but I guess it is at least worth a second look.
Cheers,
Henrik