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

Commitdf4dabb

Browse files
committed
Raise exception if return code from check-ignore is not 1
1 parent2ddb604 commitdf4dabb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎git/repo/base.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,15 @@ def ignored(self, *paths: PathLike) -> List[str]:
873873
"""
874874
try:
875875
proc:str=self.git.check_ignore(*paths)
876-
exceptGitCommandError:
877-
return []
876+
exceptGitCommandErroraserr:
877+
# If return code is 1, this means none of the items in *paths
878+
# are ignored by Git, so return an empty list. Raise the
879+
# exception on all other return codes.
880+
iferr.status==1:
881+
return []
882+
else:
883+
raise
884+
878885
returnproc.replace("\\\\","\\").replace('"',"").split("\n")
879886

880887
@property

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp