瀏覽代碼

pre-commit: do not ignore submodule when running diff-index

Without this line, if the git config specifies to ignore submodule
change (what happned in the associated bug), this script is useless
because the command will never return gitlink change

R=sokcevic

Bug: 1496925
Change-Id: I6536b95502e708e44d6fd3e4909fd30eac8c7c98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4995364
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Yiwei Zhang 1 年之前
父節點
當前提交
03a1a8936e
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      hooks/pre-commit.py

+ 2 - 1
hooks/pre-commit.py

@@ -27,7 +27,8 @@ def main():
 
     has_deps_diff = False
     staged_gitlinks = []
-    diff = git_common.run('diff-index', '--cached', 'HEAD')
+    diff = git_common.run('diff-index', '--cached', '--ignore-submodules=dirty',
+                          'HEAD')
     for line in diff.splitlines():
         path = line.split()[-1]
         if path == 'DEPS':