Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf6fa49

Browse files
saroad2Byron
authored andcommitted
Find paths ignored in .gitignore
1 parent8a9f8c5 commitdf6fa49

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎git/repo/base.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,19 @@ def _get_untracked_files(self, *args, **kwargs):
697697
finalize_process(proc)
698698
returnuntracked_files
699699

700+
defget_ignored(self,*paths):
701+
"""Checks if paths are ignored via .gitignore
702+
Doing so using the "git check-ignore" method.
703+
704+
:param paths: List of paths to check whether they are ignored or not
705+
:return: sublist of ignored paths
706+
"""
707+
try:
708+
proc=self.git.check_ignore(*paths)
709+
exceptGitCommandError:
710+
return []
711+
returnproc.replace("\\\\","\\").replace('"',"").split("\n")
712+
700713
@property
701714
defactive_branch(self):
702715
"""The name of the currently active branch.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp