Pass relevant git environment variables while calling `/allowed`
Compare changes
Files
4+ 6
− 1
@@ -22,7 +22,12 @@ class GitlabAccess
Do not update/delete: Banner broadcast message test data
Do not update/delete: Notification broadcast message test data
git gc
.In our workflow, the pre-recieve script calls the /allowed
endpoint on the
rails server. This /allowed
endpoint calls out directly to git to perform
various checks. These direct calls to git do not have the necessary
environment variables set which allow access to the "alternate object
directory" (explained above). Therefore these calls to git are not able to
access any of the new potential objects to be added during this push.
We fix this by passing the relevant environment variables
(GIT_ALTERNATE_OBJECT_DIRECTORIES
, GIT_OBJECT_DIRECTORY
, and
GIT_QUARANTINE_PATH
) to the /allowed
endpoint, which will then include
these environment variables while calling out to git.