| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2ddb604 commit df4dabb
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -873,8 +873,15 @@ def ignored(self, *paths: PathLike) -> List[str]: | |||
| 873 | 873 | """ | |
| 874 | 874 | try: | |
| 875 | 875 | proc: str = self.git.check_ignore(*paths) | |
| 876 | - except GitCommandError: | ||
| 877 | - return [] | ||
| 876 | + except GitCommandError as err: | ||
| 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 | + if err.status == 1: | ||
| 881 | + return [] | ||
| 882 | + else: | ||
| 883 | + raise | ||
| 884 | + | ||
| 878 | 885 | return proc.replace("\\\\", "\\").replace('"', "").split("\n") | |
| 879 | 886 | ||
| 880 | 887 | @property | |
| Back | FazBrowse Home | New Git URL |
0 commit comments