FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

First attempt to fix failing test of #1103 by Byron · Pull Request #1104 · gitpython-developers/GitPython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
14 changes: 10 additions & 4 deletions git/index/base.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1028,16 +1028,16 @@ def checkout(self, paths=None, force=False, fprogress=lambda *args: None, **kwar
if force:
args.append("--force")

failed_files = []
failed_reasons = []
unknown_lines = []
def handle_stderr(proc, iter_checked_out_files):
stderr = proc.stderr.read()
if not stderr:
return
# line contents:
stderr = stderr.decode(defenc)
# git-checkout-index: this already exists
failed_files = []
failed_reasons = []
unknown_lines = []
endings = (' already exists', ' is not in the cache', ' does not exist at stage', ' is unmerged')
for line in stderr.splitlines():
if not line.startswith("git checkout-index: ") and not line.startswith("git-checkout-index: "):
Expand Down Expand Up @@ -1130,7 +1130,13 @@ def handle_stderr(proc, iter_checked_out_files):
checked_out_files.append(co_path)
# END path is a file
# END for each path
self._flush_stdin_and_wait(proc, ignore_stdout=True)
try:
self._flush_stdin_and_wait(proc, ignore_stdout=True)
except GitCommandError:
# Without parsing stdout we don't know what failed.
raise CheckoutError(
"Some files could not be checked out from the index, probably because they didn't exist.",
failed_files, [], failed_reasons)

handle_stderr(proc, checked_out_files)
return checked_out_files
Expand Down

Back | FazBrowse Home | New Git URL