pre-receive: tolerate an unlimited number of .pack files
commit40a2e44f45e2873b37daf5dccfaa4ec8a882c37b
authorKyle J. McKay <mackyle@gmail.com>
Tue, 3 May 2016 22:18:18 +0000 (3 15:18 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Tue, 3 May 2016 22:18:18 +0000 (3 15:18 -0700)
tree9ccd1e6283a4fe407b2fd240b47e00df468114fa
parentee866ec05fb9bfbcae2c2c383f4d94a402b9837d
pre-receive: tolerate an unlimited number of .pack files

The pre-receive hook attempts to make sure any just-received
packs are writable by user and group so they can be successfully
touched later during gc.

Previously the expression objects/pack/pack-$octet20.pack was used
to pass a list of pack filenames to chmod.  However, in the
presence of an obscene number of .pack files, that expression could
result in an expansion that exceeds the command line length
limitation.

Replace the problematic line with a find | xargs chmod pipe so that
any number of .pack files can be accomodated (there really SHOULD
never be all that many).  This also allows an optimization since find
can exclude .pack files that already have ug+w permissions.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
hooks/pre-receive