Skip to content

Commit 20a77bc

Browse files
committed
Ignore submodule directory when checking files (NO_JIRA)
1 parent 2196d27 commit 20a77bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main/githooks.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ def get_commit_files():
179179
'''
180180
if _is_github_event():
181181
if _is_pull_request():
182-
output = _get_output(f'git diff --name-status remotes/origin/{os.environ["GITHUB_BASE_REF"]}..remotes/origin/{os.environ["GITHUB_HEAD_REF"]} --')
182+
output = _get_output(f'git diff --ignore-submodules --name-status remotes/origin/{os.environ["GITHUB_BASE_REF"]}..remotes/origin/{os.environ["GITHUB_HEAD_REF"]} --')
183183
else:
184-
output = _get_output('git diff --name-status HEAD~.. --')
184+
output = _get_output('git diff --ignore-submodules --name-status HEAD~.. --')
185185
else:
186-
output = _get_output('git diff-index HEAD --cached')
186+
output = _get_output('git diff-index --ignore-submodules HEAD --cached')
187187
result = defaultdict(list)
188188
for line in output.splitlines():
189189
parts = line.split()

0 commit comments

Comments
 (0)