Skip to content

Commit df5095c

Browse files
authored
Merge pull request #499 from pelson/empty_refs
Allowed remotes to have no refs.
2 parents 657cd7e + 25c2075 commit df5095c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ Contributors are:
1414
-Sebastian Thiel <byronimo _at_ gmail.com>
1515
-Jonathan Chu <jonathan.chu _at_ me.com>
1616
-Vincent Driessen <me _at_ nvie.com>
17+
-Phil Elson <pelson _dot_ pub _at_ gmail.com>
1718

1819
Portions derived from other open source works and are clearly marked.

git/remote.py

-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ def refs(self):
511511
remote.refs.master # yields RemoteReference('/refs/remotes/origin/master')"""
512512
out_refs = IterableList(RemoteReference._id_attribute_, "%s/" % self.name)
513513
out_refs.extend(RemoteReference.list_items(self.repo, remote=self.name))
514-
assert out_refs, "Remote %s did not have any references" % self.name
515514
return out_refs
516515

517516
@property

git/test/test_refs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ def test_head_reset(self, rw_repo):
320320
assert remote_refs_so_far
321321

322322
for remote in remotes:
323-
# remotes without references throw
324-
self.failUnlessRaises(AssertionError, getattr, remote, 'refs')
323+
# remotes without references should produce an empty list
324+
self.assertEqual(remote.refs, [])
325325
# END for each remote
326326

327327
# change where the active head points to

0 commit comments

Comments
 (0)