summaryrefslogtreecommitdiff
path: root/lib/python/qmk/git.py
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-06-14 13:55:32 +0000
committerQMK Bot <hello@qmk.fm>2022-06-14 13:55:32 +0000
commit4cde5c243b2d64efead2b7ce67ddb5e05c100024 (patch)
tree6a21d94c9d3d947f9e1642212edeeb3d9e48c8fe /lib/python/qmk/git.py
parent87e1ff218d01b193d84c7d2e396cded57fad3fba (diff)
parentf37de9a212e79e9c4c05c4298ba82ffe527d7132 (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/git.py')
-rw-r--r--lib/python/qmk/git.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/python/qmk/git.py b/lib/python/qmk/git.py
index beeb689144..f493628492 100644
--- a/lib/python/qmk/git.py
+++ b/lib/python/qmk/git.py
@@ -108,3 +108,12 @@ def git_check_deviation(active_branch):
cli.run(['git', 'fetch', 'upstream', active_branch])
deviations = cli.run(['git', '--no-pager', 'log', f'upstream/{active_branch}...{active_branch}'])
return bool(deviations.returncode)
+
+
+def git_get_ignored_files(check_dir='.'):
+ """Return a list of files that would be captured by the current .gitingore
+ """
+ invalid = cli.run(['git', 'ls-files', '-c', '-o', '-i', '--exclude-standard', check_dir])
+ if invalid.returncode != 0:
+ return []
+ return invalid.stdout.strip().splitlines()