diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2016-06-13 10:07:40 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2016-06-13 10:07:40 +0200 |
commit | 15ee5a505b43741cdb7c79f41ebfa3d881910a6c (patch) | |
tree | 53d38efc5e78a7114f0727192cfc156d992b91c3 /git/remote.py | |
parent | da86442f6a7bf1263fb5aafdaf904ed2f7db839f (diff) | |
download | gitpython-15ee5a505b43741cdb7c79f41ebfa3d881910a6c.tar.gz |
fix(misc): various cleanup
Just went through all changes and adjusted them to the best of my
abilities. As there are no tests to claim otherwise, I believe
this is correct enough.
However, it becomes evident that it's no longer possible to just
make changes without backing them with a respective test.
Diffstat (limited to 'git/remote.py')
-rw-r--r-- | git/remote.py | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/git/remote.py b/git/remote.py index 12a681b0..347d2844 100644 --- a/git/remote.py +++ b/git/remote.py @@ -570,16 +570,11 @@ class Remote(LazyMixin, Iterable): progress_handler = progress.new_message_handler() - error_message = None stderr_text = None for line in proc.stderr: line = force_text(line) for pline in progress_handler(line): - if line.startswith('fatal:') or line.startswith('error:'): - error_message = "Error when fetching: %s" % (line,) - break - # END handle special messages for cmd in cmds: if len(line) > 1 and line[0] == ' ' and line[1] == cmd: @@ -587,20 +582,13 @@ class Remote(LazyMixin, Iterable): continue # end find command code # end for each comand code we know - - if error_message is not None: - break # end for each line progress didn't handle - - if error_message is not None: - stderr_text = proc.stderr.read() - # end + if progress.error_lines(): + stderr_text = '\n'.join(progress.error_lines()) + finalize_process(proc, stderr=stderr_text) - if error_message is not None: - raise GitCommandError(error_message, 2, stderr=stderr_text) - # read head information fp = open(join(self.repo.git_dir, 'FETCH_HEAD'), 'rb') fetch_head_info = [l.decode(defenc) for l in fp.readlines()] @@ -646,10 +634,6 @@ class Remote(LazyMixin, Iterable): try: handle_process_output(proc, stdout_handler, progress_handler, finalize_process) - except GitCommandError as err: - # convert any error from wait() into the same error with stdout lines - raise GitCommandError(err.command, err.status, progress.get_stderr()) - except Exception: if len(output) == 0: raise |