summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2016-08-19 10:19:43 +0200
committerGitHub <noreply@github.com>2016-08-19 10:19:43 +0200
commitdf5095c16894e6f4da814302349e8e32f84c8c13 (patch)
tree1b31919357bdaacaf7bb0b6ce1553a0d0ce2b032
parent657cd7e47571710246375433795ab60520e20434 (diff)
parent25c207592034d00b14fd9df644705f542842fa04 (diff)
downloadgitpython-df5095c16894e6f4da814302349e8e32f84c8c13.tar.gz
Merge pull request #499 from pelson/empty_refs
Allowed remotes to have no refs.
-rw-r--r--AUTHORS1
-rw-r--r--git/remote.py1
-rw-r--r--git/test/test_refs.py4
3 files changed, 3 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index 15fff4a3..e2c3293c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -14,5 +14,6 @@ Contributors are:
-Sebastian Thiel <byronimo _at_ gmail.com>
-Jonathan Chu <jonathan.chu _at_ me.com>
-Vincent Driessen <me _at_ nvie.com>
+-Phil Elson <pelson _dot_ pub _at_ gmail.com>
Portions derived from other open source works and are clearly marked.
diff --git a/git/remote.py b/git/remote.py
index c024030d..12129460 100644
--- a/git/remote.py
+++ b/git/remote.py
@@ -511,7 +511,6 @@ class Remote(LazyMixin, Iterable):
remote.refs.master # yields RemoteReference('/refs/remotes/origin/master')"""
out_refs = IterableList(RemoteReference._id_attribute_, "%s/" % self.name)
out_refs.extend(RemoteReference.list_items(self.repo, remote=self.name))
- assert out_refs, "Remote %s did not have any references" % self.name
return out_refs
@property
diff --git a/git/test/test_refs.py b/git/test/test_refs.py
index b75b967b..879b8caa 100644
--- a/git/test/test_refs.py
+++ b/git/test/test_refs.py
@@ -320,8 +320,8 @@ class TestRefs(TestBase):
assert remote_refs_so_far
for remote in remotes:
- # remotes without references throw
- self.failUnlessRaises(AssertionError, getattr, remote, 'refs')
+ # remotes without references should produce an empty list
+ self.assertEqual(remote.refs, [])
# END for each remote
# change where the active head points to