aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gbp/git.py3
-rw-r--r--tests/test_GitRepository.py13
2 files changed, 14 insertions, 2 deletions
diff --git a/gbp/git.py b/gbp/git.py
index c5239599..31d7cab9 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -743,8 +743,7 @@ class GitRepository(object):
@param repo: repository to fetch from
@type repo: C{str}
"""
- if repo:
- args = [repo]
+ args = [repo] if repo else []
self._git_command("fetch", args)
diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py
index dd713c12..f7e5e97a 100644
--- a/tests/test_GitRepository.py
+++ b/tests/test_GitRepository.py
@@ -333,6 +333,19 @@ def test_pull():
>>> clone.pull()
"""
+def test_fetch():
+ """
+ Fetch from a remote repository
+
+ Methods tested:
+ - L{gbp.git.GitRepository.fetch}
+
+ >>> import gbp.git, os
+ >>> d = os.path.join(clone_dir, 'gbp_%s_test_repo' % __name__)
+ >>> clone = gbp.git.GitRepository(d)
+ >>> clone.fetch()
+ """
+
def test_create_bare():
"""
Create a bare repository