diff options
1 files changed, 25 insertions, 0 deletions
| -rwxr-xr-x | scripts/unprotect | 25 |
diff --git a/scripts/unprotect b/scripts/unprotect new file mode 100755 index 0000000..d1b47ca --- /dev/null +++ b/scripts/unprotect @@ -0,0 +1,25 @@ +#!/bin/bash + +if [ -z "$1" ] +then + printf 'Repository : ' + read + set "$REPLY" +fi + +if [ ! -f "$1/HEAD" ] +then + echo 'Not a repository!' + exit 1 +fi + +if [ ! -w "$1/HEAD" ] +then + echo 'Read-only repository!' + exit 2 +fi + +if cd "$1" +then + git config unset --file ./config receive.denyNonFastForwards +fi |
