| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3dd71d3 commit 21e21d0
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1028,16 +1028,16 @@ def checkout(self, paths=None, force=False, fprogress=lambda *args: None, **kwar | |||
| 1028 | 1028 | if force: | |
| 1029 | 1029 | args.append("--force") | |
| 1030 | 1030 | ||
| 1031 | + failed_files = [] | ||
| 1032 | + failed_reasons = [] | ||
| 1033 | + unknown_lines = [] | ||
| 1031 | 1034 | def handle_stderr(proc, iter_checked_out_files): | |
| 1032 | 1035 | stderr = proc.stderr.read() | |
| 1033 | 1036 | if not stderr: | |
| 1034 | 1037 | return | |
| 1035 | 1038 | # line contents: | |
| 1036 | 1039 | stderr = stderr.decode(defenc) | |
| 1037 | 1040 | # git-checkout-index: this already exists | |
| 1038 | - failed_files = [] | ||
| 1039 | - failed_reasons = [] | ||
| 1040 | - unknown_lines = [] | ||
| 1041 | 1041 | endings = (' already exists', ' is not in the cache', ' does not exist at stage', ' is unmerged') | |
| 1042 | 1042 | for line in stderr.splitlines(): | |
| 1043 | 1043 | if not line.startswith("git checkout-index: ") and not line.startswith("git-checkout-index: "): | |
@@ -1130,7 +1130,13 @@ def handle_stderr(proc, iter_checked_out_files): | |||
| 1130 | 1130 | checked_out_files.append(co_path) | |
| 1131 | 1131 | # END path is a file | |
| 1132 | 1132 | # END for each path | |
| 1133 | - self._flush_stdin_and_wait(proc, ignore_stdout=True) | ||
| 1133 | + try: | ||
| 1134 | + self._flush_stdin_and_wait(proc, ignore_stdout=True) | ||
| 1135 | + except GitCommandError: | ||
| 1136 | + # Without parsing stdout we don't know what failed. | ||
| 1137 | + raise CheckoutError( | ||
| 1138 | + "Some files could not be checked out from the index, probably because they didn't exist.", | ||
| 1139 | + failed_files, [], failed_reasons) | ||
| 1134 | 1140 | ||
| 1135 | 1141 | handle_stderr(proc, checked_out_files) | |
| 1136 | 1142 | return checked_out_files | |
| Back | FazBrowse Home | New Git URL |
0 commit comments