From 96c7ac239a2c9e303233e58daee02101cc4ebf3d Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 23 Feb 2011 00:06:38 +0100 Subject: Fixed incorrect handling of rev_parse if it was fed with branches that looked like hexshas. Thanks to Ning (frostyplanet) who pointed this issue out --- git/test/test_repo.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'git/test/test_repo.py') diff --git a/git/test/test_repo.py b/git/test/test_repo.py index f517b9f1..deadbe9a 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -464,6 +464,12 @@ class TestRepo(TestBase): return orig_obj + @with_rw_repo('HEAD', bare=False) + def test_rw_rev_parse(self, rwrepo): + # verify it does not confuse branches with hexsha ids + ahead = rwrepo.create_head('aaaaaaaa') + assert(rwrepo.rev_parse(str(ahead)) == ahead.commit) + def test_rev_parse(self): rev_parse = self.rorepo.rev_parse @@ -573,7 +579,6 @@ class TestRepo(TestBase): # currently, nothing more is supported self.failUnlessRaises(NotImplementedError, rev_parse, "@{1 week ago}") - def test_repo_odbtype(self): target_type = GitDB if sys.version_info[1] < 5: -- cgit v1.2.1