OLD | NEW |
1 #!/bin/bash | 1 #!/bin/sh |
2 | 2 |
3 submods=$(git diff-index --cached --ignore-submodules=dirty HEAD | grep -e '^:16
0000' -e '^:...... 160000' | xargs) | 3 submods=$(git diff-index --cached --ignore-submodules=dirty HEAD | grep -e '^:16
0000' -e '^:...... 160000' | xargs) |
4 if test "$submods"; then | 4 if test "$submods"; then |
5 echo "You are trying to commit changes to the following submodules:" 1>&2 | 5 echo "You are trying to commit changes to the following submodules:" 1>&2 |
6 echo 1>&2 | 6 echo 1>&2 |
7 echo $submods | cut -d ' ' -f 6 | sed 's/^/ /g' 1>&2 | 7 echo $submods | cut -d ' ' -f 6 | sed 's/^/ /g' 1>&2 |
8 cat <<EOF 1>&2 | 8 cat <<EOF 1>&2 |
9 | 9 |
10 Submodule commits are not allowed. Please run: | 10 Submodule commits are not allowed. Please run: |
11 | 11 |
(...skipping 13 matching lines...) Expand all Loading... |
25 | 25 |
26 if test "$(git diff-index --cached HEAD .gitmodules)"; then | 26 if test "$(git diff-index --cached HEAD .gitmodules)"; then |
27 cat <<EOF 1>&2 | 27 cat <<EOF 1>&2 |
28 You are trying to commit a change to .gitmodules. That is not allowed. | 28 You are trying to commit a change to .gitmodules. That is not allowed. |
29 To make changes to submodule names/paths, edit DEPS. | 29 To make changes to submodule names/paths, edit DEPS. |
30 EOF | 30 EOF |
31 exit 1 | 31 exit 1 |
32 fi | 32 fi |
33 | 33 |
34 exit 0 | 34 exit 0 |
OLD | NEW |