def test_commit_in_master_branch(repo: Git): assert repo.get_head().hash == '29e929fbc5dc6a2e9c620069b24e2a143af4285f' repo.checkout('8986af2a679759e5a15794f6d56e6d46c3f302f1') git_to_change_head = Git('test-repos/branches_merged') commit = git_to_change_head.get_commit('8169f76a3d7add54b4fc7bca7160d1f1eede6eda') assert commit.in_main_branch is False repo.reset() assert repo.get_head().hash == '29e929fbc5dc6a2e9c620069b24e2a143af4285f'
def test_get_head(repo: Git): assert repo is not None cs = repo.get_head() assert cs is not None assert cs.hash == 'da39b1326dbc2edfe518b90672734a08f3c13458' assert cs.author_date.timestamp() == 1522164679