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

Commit21e21d0

Browse files
committed
First attempt to fix failing test of#1103
However, the test asserts on the provided context to be correct,which is hard to do in this branch while it's easy to doubt the valueof this.Lastly, there seems to be no way to ignore errors in `git` withoutmuting all output, which is in fact parsed.Maybe it's possible to ignore errors while parsing the new kind oferror message.
1 parent3dd71d3 commit21e21d0

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

‎git/index/base.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,16 +1028,16 @@ def checkout(self, paths=None, force=False, fprogress=lambda *args: None, **kwar
10281028
ifforce:
10291029
args.append("--force")
10301030

1031+
failed_files= []
1032+
failed_reasons= []
1033+
unknown_lines= []
10311034
defhandle_stderr(proc,iter_checked_out_files):
10321035
stderr=proc.stderr.read()
10331036
ifnotstderr:
10341037
return
10351038
# line contents:
10361039
stderr=stderr.decode(defenc)
10371040
# git-checkout-index: this already exists
1038-
failed_files= []
1039-
failed_reasons= []
1040-
unknown_lines= []
10411041
endings= (' already exists',' is not in the cache',' does not exist at stage',' is unmerged')
10421042
forlineinstderr.splitlines():
10431043
ifnotline.startswith("git checkout-index: ")andnotline.startswith("git-checkout-index: "):
@@ -1130,7 +1130,13 @@ def handle_stderr(proc, iter_checked_out_files):
11301130
checked_out_files.append(co_path)
11311131
# END path is a file
11321132
# 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+
exceptGitCommandError:
1136+
# Without parsing stdout we don't know what failed.
1137+
raiseCheckoutError(
1138+
"Some files could not be checked out from the index, probably because they didn't exist.",
1139+
failed_files, [],failed_reasons)
11341140

11351141
handle_stderr(proc,checked_out_files)
11361142
returnchecked_out_files

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp