Skip to content

Commit

Permalink
fix tests that assumed default initial branch setting
Browse files Browse the repository at this point in the history
  • Loading branch information
SonOfLilit committed Jul 30, 2024
1 parent a943fa3 commit 10fb861
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions test/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 10fb861

Please sign in to comment.