summaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
Diffstat (limited to 'git')
-rw-r--r--git/db/cmd/base.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/git/db/cmd/base.py b/git/db/cmd/base.py
index 78adbc6e..cbf4e29b 100644
--- a/git/db/cmd/base.py
+++ b/git/db/cmd/base.py
@@ -141,6 +141,16 @@ def get_push_info(repo, remotename_or_url, proc, progress):
finalize_process(proc)
return output
+def add_progress(kwargs, git):
+ """Add the --progress flag to the given kwargs dict if supported by the
+ git command
+ :return: possibly altered kwargs"""
+ v = git.version_info
+ if v[0] > 1 or v[1] > 7 or v[2] > 0 or v[3] > 3:
+ kwargs['progress'] = True
+ #END handle --progress
+ return kwargs
+
#} END utilities
class CmdRemoteProgress(RemoteProgress):
@@ -517,7 +527,7 @@ class CmdTransportMixin(TransportDB):
:param refspecs: single string, RefSpec instance or list of such or None.
:param progress: RemoteProgress derived instance or None
:param **kwargs: Additional arguments to be passed to the git-push process"""
- proc = self._git.push(url, refspecs, porcelain=True, as_process=True, **kwargs)
+ proc = self._git.push(url, refspecs, porcelain=True, as_process=True, **add_progress(kwargs, self.git))
return get_push_info(self, url, proc, CmdRemoteProgress(progress))
def pull(self, url, refspecs=None, progress=None, **kwargs):
@@ -527,7 +537,7 @@ class CmdTransportMixin(TransportDB):
:param url: may be a remote name or a url
:param refspecs: see push()
:param progress: see push()"""
- proc = self._git.pull(url, refspecs, with_extended_output=True, as_process=True, v=True, **kwargs)
+ proc = self._git.pull(url, refspecs, with_extended_output=True, as_process=True, v=True, **add_progress(kwargs, self.git))
return get_fetch_info_from_stderr(self, proc, CmdRemoteProgress(progress))
def fetch(self, url, refspecs=None, progress=None, **kwargs):
@@ -535,7 +545,7 @@ class CmdTransportMixin(TransportDB):
:param url: may be a remote name or a url
:param refspecs: see push()
:param progress: see push()"""
- proc = self._git.fetch(url, refspecs, with_extended_output=True, as_process=True, v=True, **kwargs)
+ proc = self._git.fetch(url, refspecs, with_extended_output=True, as_process=True, v=True, **add_progress(kwargs, self.git))
return get_fetch_info_from_stderr(self, proc, CmdRemoteProgress(progress))
#} end transport db interface
@@ -740,7 +750,7 @@ class CmdHighLevelRepository(HighLevelRepository):
# END windows handling
try:
- proc = git.clone(url, path, with_extended_output=True, as_process=True, v=True, **kwargs)
+ proc = git.clone(url, path, with_extended_output=True, as_process=True, v=True, **add_progress(kwargs, git))
if progress is not None:
digest_process_messages(proc.stderr, progress)
#END digest progress messages