From 9f22f0895520502efb85a8668b69209a1aa05034 Mon Sep 17 00:00:00 2001 From: Thomas Johannesmeyer Date: Tue, 7 May 2019 14:30:21 +0200 Subject: [PATCH] Implement update call when the object is "up to date" #871 --- git/util.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/git/util.py b/git/util.py index a3b1fbfb1..49f238fd8 100644 --- a/git/util.py +++ b/git/util.py @@ -390,6 +390,21 @@ def _parse_progress_line(self, line): if len(self.error_lines) > 0 or self._cur_line.startswith(('error:', 'fatal:')): self.error_lines.append(self._cur_line) return [] + elif 'up to date' in self._cur_line: + # Checking this way instead of startswith, because debugging for + # startswith(' = [up to date]') is going to be a major pain if just + # a single space or bracket changes. + + # Strip the initial ' = [up to date]' from the line + message_string = line.split('date]', 1)[-1] + + # Trim whitespace + message_string = ' '.join(message_string.split()) + + self.update(0, + 1, + 1, + message_string) sub_lines = line.split('\r') failed_lines = []