Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2864)

Unified Diff: build/git-hooks/pre-commit

Issue 225583008: Silence git-hooks/pre-commit in the absence of .gitmodules (take 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/git-hooks/pre-commit
diff --git a/build/git-hooks/pre-commit b/build/git-hooks/pre-commit
index 790e14ec8412cd5a954cb785e1bce78367e6813d..41b596344c4bc0295f5ad383fb8f74b291c5eda2 100755
--- a/build/git-hooks/pre-commit
+++ b/build/git-hooks/pre-commit
@@ -49,7 +49,7 @@ gitmodules_diff() {
git diff-index --cached "$1" .gitmodules
}
-if test "$(git ls-files .gitmodules)" -a "$(gitmodules_diff $head_ref)"; then
+if [ "$(git ls-files .gitmodules)" ] && [ "$(gitmodules_diff $head_ref)" ]; 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698