Skip to content

Commit 4298468

Browse files
committed
Fixed ref-log related issue in the test suite to assure it will not give false positives in repositories that are freshly checked out
1 parent 6f96058 commit 4298468

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

git/test/db/base.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,15 @@ def test_rev_parse(self):
584584
assert rev_parse(refspec+":CHANGES").type == 'blob'
585585
#END operate on non-detached head
586586

587-
# the last position
588-
assert rev_parse('@{1}') != head.commit
587+
# the most recent previous position of the currently checked out branch
588+
589+
try:
590+
assert rev_parse('@{1}') != head.commit
591+
except IndexError:
592+
# on new checkouts, there isn't even a single past branch position
593+
# in the log
594+
pass
595+
#END handle fresh checkouts
589596

590597
# position doesn't exist
591598
self.failUnlessRaises(IndexError, rev_parse, '@{10000}')

0 commit comments

Comments
 (0)