From d001b396074e4f0f67703da8d99de009f961fc6e Mon Sep 17 00:00:00 2001 From: wusisu Date: Wed, 3 May 2017 13:08:33 +0800 Subject: [PATCH] remote: compatibility with git version > 2.10 --- git/remote.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git/remote.py b/git/remote.py index 60319ce14..fd76e592a 100644 --- a/git/remote.py +++ b/git/remote.py @@ -212,11 +212,16 @@ class FetchInfo(object): _flag_map = {'!': ERROR, '+': FORCED_UPDATE, - '-': TAG_UPDATE, '*': 0, '=': HEAD_UPTODATE, ' ': FAST_FORWARD} + v = Git().version_info[:2] + if v >= (2, 10): + _flag_map['t'] = TAG_UPDATE + else: + _flag_map['-'] = TAG_UPDATE + def __init__(self, ref, flags, note='', old_commit=None, remote_ref_path=None): """ Initialize a new instance @@ -629,7 +634,7 @@ def _get_fetch_info_from_stderr(self, proc, progress): fetch_info_lines = list() # Basically we want all fetch info lines which appear to be in regular form, and thus have a # command character. Everything else we ignore, - cmds = set(PushInfo._flag_map.keys()) & set(FetchInfo._flag_map.keys()) + cmds = set(FetchInfo._flag_map.keys()) progress_handler = progress.new_message_handler() handle_process_output(proc, None, progress_handler, finalizer=None, decode_streams=False)