summaryrefslogtreecommitdiff
path: root/git/remote.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2017-09-28 15:44:15 +0200
committerGitHub <noreply@github.com>2017-09-28 15:44:15 +0200
commit2eb6cf0855232da2b8f37785677d1f58c8e86817 (patch)
treeecb856bea6ed63e9c2baf8365a4e0a9030b0b3a3 /git/remote.py
parent2af601d5800a39ab04e9fe6cf22ef7b917ab5d67 (diff)
parenta56136f9cb48a17ae15b59ae0f3f99d9303b1cb1 (diff)
downloadgitpython-2eb6cf0855232da2b8f37785677d1f58c8e86817.tar.gz
Merge pull request #640 from njalerikson/adding_setup_for_git_executable
Adding setup for git executable
Diffstat (limited to 'git/remote.py')
-rw-r--r--git/remote.py41
1 files changed, 31 insertions, 10 deletions
diff --git a/git/remote.py b/git/remote.py
index 81719f4b..7261be81 100644
--- a/git/remote.py
+++ b/git/remote.py
@@ -211,17 +211,38 @@ class FetchInfo(object):
_re_fetch_result = re.compile(r'^\s*(.) (\[?[\w\s\.$@]+\]?)\s+(.+) -> ([^\s]+)( \(.*\)?$)?')
- _flag_map = {'!': ERROR,
- '+': FORCED_UPDATE,
- '*': 0,
- '=': HEAD_UPTODATE,
- ' ': FAST_FORWARD}
+ _flag_map = {
+ '!': ERROR,
+ '+': FORCED_UPDATE,
+ '*': 0,
+ '=': HEAD_UPTODATE,
+ ' ': FAST_FORWARD,
+ '-': TAG_UPDATE,
+ }
- v = Git().version_info[:2]
- if v >= (2, 10):
- _flag_map['t'] = TAG_UPDATE
- else:
- _flag_map['-'] = TAG_UPDATE
+ @classmethod
+ def refresh(cls):
+ """This gets called by the refresh function (see the top level
+ __init__).
+ """
+ # clear the old values in _flag_map
+ try:
+ del cls._flag_map["t"]
+ except KeyError:
+ pass
+
+ try:
+ del cls._flag_map["-"]
+ except KeyError:
+ pass
+
+ # set the value given the git version
+ if Git().version_info[:2] >= (2, 10):
+ cls._flag_map["t"] = cls.TAG_UPDATE
+ else:
+ cls._flag_map["-"] = cls.TAG_UPDATE
+
+ return True
def __init__(self, ref, flags, note='', old_commit=None, remote_ref_path=None):
"""