5 git diff-tree
-r --ignore-submodules=dirty
"$1" "$2" |
grep -e '^:160000' -e '^:...... 160000' |
xargs
7 git diff-index
--cached --ignore-submodules=dirty
"$1" |
grep -e '^:160000' -e '^:...... 160000' |
xargs
11 if git rev-parse
--verify --quiet --no-revs MERGE_HEAD
; then
12 merge_base
=$
(git merge-base HEAD MERGE_HEAD
)
13 if test -z "$(submodule_diff $merge_base HEAD)"; then
14 # Most up-to-date submodules are in MERGE_HEAD.
17 # Most up-to-date submodules are in HEAD.
21 # No merge in progress. Submodules must match HEAD.
25 submods
=$
(submodule_diff
$head_ref)
26 if test "$submods"; then
27 echo "You are trying to commit changes to the following submodules:" 1>&2
29 echo $submods | cut
-d ' ' -f 6 |
sed 's/^/ /g' 1>&2
32 Submodule commits are not allowed. Please run:
34 git status --ignore-submodules=dirty
38 git diff-index --cached --ignore-submodules=dirty HEAD
40 ... to see what's in your index.
42 If you're really and truly trying to roll the version of a submodule, you should
43 commit the new version to DEPS, instead.
49 git diff-index
--cached "$1" .gitmodules
52 if [ "$(git ls-files .gitmodules)" ] && [ "$(gitmodules_diff $head_ref)" ]; then
54 You are trying to commit a change to .gitmodules. That is not allowed.
55 To make changes to submodule names/paths, edit DEPS.