Created
June 15, 2012 23:52
-
-
Save nvanderw/2939259 to your computer and use it in GitHub Desktop.
A pre-receive hook for blacklisting certain objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Blacklist commit 1abfdd7 | |
root=$(awk '{print $2}') | |
objects=$(git rev-list --objects $root | awk '{print $1}') | |
echo $objects | grep 1abfdd7cb8c67ead50757ea596aa0f01b0ab1389 > /dev/null | |
if [[ $? -eq 0 ]] | |
then | |
exit 1 | |
else | |
exit 0 | |
fi | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment