def check_repository(repo): assert os.path.isdir(repo) # it's a bare repo assert not os.path.exists(os.path.join(repo, '.git')) sha = commands.rev_parse( rev='refs/heads/master', repo=repo, ) assert sha is None, 'Expected no commits yet: %r' % sha value = commands.get_symbolic_ref(repo=repo, ref='HEAD') eq(value, 'refs/heads/master')
def test_symbolic_ref_ok(): tmp = maketemp() commands.init_bare(tmp) got = commands.get_symbolic_ref(repo=tmp, ref='HEAD') eq(got, 'refs/heads/master')