From 10fb8613b47ed766b1f0ce2048cfebc0e4808aca Mon Sep 17 00:00:00 2001 From: Aur Saraf Date: Tue, 30 Jul 2024 04:25:35 +0300 Subject: [PATCH] fix tests that assumed default initial branch setting --- test/test_diff.py | 2 +- test/test_repo.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_diff.py b/test/test_diff.py index 612fbd9e0..695025396 100644 --- a/test/test_diff.py +++ b/test/test_diff.py @@ -51,7 +51,7 @@ def _assert_diff_format(self, diffs): @with_rw_directory def test_diff_with_staged_file(self, rw_dir): # SET UP INDEX WITH MULTIPLE STAGES - r = Repo.init(rw_dir) + r = Repo.init(rw_dir, initial_branch="master") fp = osp.join(rw_dir, "hello.txt") with open(fp, "w") as fs: fs.write("hello world") diff --git a/test/test_repo.py b/test/test_repo.py index ee1dfe0c7..7a9b2a110 100644 --- a/test/test_repo.py +++ b/test/test_repo.py @@ -1193,7 +1193,7 @@ def test_remote_method(self): @with_rw_directory def test_empty_repo(self, rw_dir): """Assure we can handle empty repositories""" - r = Repo.init(rw_dir, mkdir=False) + r = Repo.init(rw_dir, mkdir=False, initial_branch="master") # It's ok not to be able to iterate a commit, as there is none. self.assertRaises(ValueError, r.iter_commits) self.assertEqual(r.active_branch.name, "master") @@ -1352,7 +1352,7 @@ def test_git_work_tree_env(self, rw_dir): @with_rw_directory def test_rebasing(self, rw_dir): - r = Repo.init(rw_dir) + r = Repo.init(rw_dir, initial_branch="master") fp = osp.join(rw_dir, "hello.txt") r.git.commit( "--allow-empty",