From 4298468f68876683afd17d50c75ac9ea6ae2ed16 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 1 Jun 2011 13:19:57 +0200 Subject: Fixed ref-log related issue in the test suite to assure it will not give false positives in repositories that are freshly checked out --- git/test/db/base.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'git/test') diff --git a/git/test/db/base.py b/git/test/db/base.py index b0bc76f9..5291ba03 100644 --- a/git/test/db/base.py +++ b/git/test/db/base.py @@ -584,8 +584,15 @@ class RepoBase(TestDBBase): assert rev_parse(refspec+":CHANGES").type == 'blob' #END operate on non-detached head - # the last position - assert rev_parse('@{1}') != head.commit + # the most recent previous position of the currently checked out branch + + try: + assert rev_parse('@{1}') != head.commit + except IndexError: + # on new checkouts, there isn't even a single past branch position + # in the log + pass + #END handle fresh checkouts # position doesn't exist self.failUnlessRaises(IndexError, rev_parse, '@{10000}') -- cgit v1.2.1