Browse code
(init)
Ed Langley authored on 29/10/2020 22:10:40
Showing 2 changed files
Showing 2 changed files
0 | 10 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,18 @@ |
1 |
+#!/bin/sh |
|
2 |
+# |
|
3 |
+# An example hook script to verify what is about to be committed. |
|
4 |
+# Called by "git commit" with no arguments. The hook should |
|
5 |
+# exit with non-zero status after issuing an appropriate message if |
|
6 |
+# it wants to stop the commit. |
|
7 |
+# |
|
8 |
+# To enable this hook, rename this file to "pre-commit". |
|
9 |
+ |
|
10 |
+# Redirect output to stderr. |
|
11 |
+exec 1>&2 |
|
12 |
+ |
|
13 |
+# Cross platform projects tend to avoid non-ASCII filenames; prevent |
|
14 |
+# them from being added to the repository. We exploit the fact that the |
|
15 |
+# printable range starts at the space character and ends with tilde. |
|
16 |
+if git diff --cached | grep '[+].*NOCOMMIT'; then |
|
17 |
+ exit 1 |
|
18 |
+fi |