Skip to content

Commit

Permalink
Silence git-hooks/pre-commit in the absence of .gitmodules.
Browse files Browse the repository at this point in the history
Other projects use depot_tools (which pulls in this hook) and chromium's build/
(where the hook lives) but don't use git modules (e.g. webrtc).

TBR=szager@chromium.org

Review URL: https://codereview.chromium.org/196413021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257470 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
fischman@chromium.org committed Mar 17, 2014
1 parent 6c38e7f commit 7904a4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/git-hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ EOF
exit 1
fi

if test "$(git diff-index --cached HEAD .gitmodules)"; then
if [[ -n "$(git ls-files .gitmodules)" &&
-n "$(git diff-index --cached HEAD .gitmodules)" ]]; then
cat <<EOF 1>&2
You are trying to commit a change to .gitmodules. That is not allowed.
To make changes to submodule names/paths, edit DEPS.
Expand Down

0 comments on commit 7904a4e

Please sign in to comment.