Skip to content

Commit 10fb861

Browse files
committed
fix tests that assumed default initial branch setting
1 parent a943fa3 commit 10fb861

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: test/test_diff.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _assert_diff_format(self, diffs):
5151
@with_rw_directory
5252
def test_diff_with_staged_file(self, rw_dir):
5353
# SET UP INDEX WITH MULTIPLE STAGES
54-
r = Repo.init(rw_dir)
54+
r = Repo.init(rw_dir, initial_branch="master")
5555
fp = osp.join(rw_dir, "hello.txt")
5656
with open(fp, "w") as fs:
5757
fs.write("hello world")

Diff for: test/test_repo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ def test_remote_method(self):
11931193
@with_rw_directory
11941194
def test_empty_repo(self, rw_dir):
11951195
"""Assure we can handle empty repositories"""
1196-
r = Repo.init(rw_dir, mkdir=False)
1196+
r = Repo.init(rw_dir, mkdir=False, initial_branch="master")
11971197
# It's ok not to be able to iterate a commit, as there is none.
11981198
self.assertRaises(ValueError, r.iter_commits)
11991199
self.assertEqual(r.active_branch.name, "master")
@@ -1352,7 +1352,7 @@ def test_git_work_tree_env(self, rw_dir):
13521352

13531353
@with_rw_directory
13541354
def test_rebasing(self, rw_dir):
1355-
r = Repo.init(rw_dir)
1355+
r = Repo.init(rw_dir, initial_branch="master")
13561356
fp = osp.join(rw_dir, "hello.txt")
13571357
r.git.commit(
13581358
"--allow-empty",

0 commit comments

Comments
 (0)