We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents decb360 + 1b5f64e commit 44afe4cCopy full SHA for 44afe4c
1 file changed
src/git/tests/test_server.py
@@ -143,13 +143,15 @@ def test_git_diff_staged_empty(test_repository):
143
assert result == ""
144
145
def test_git_diff(test_repository):
146
+ # Get the default branch name (could be "main" or "master")
147
+ default_branch = test_repository.active_branch.name
148
test_repository.git.checkout("-b", "feature-diff")
149
file_path = Path(test_repository.working_dir) / "test.txt"
150
file_path.write_text("feature changes")
151
test_repository.index.add(["test.txt"])
152
test_repository.index.commit("feature commit")
153
- result = git_diff(test_repository, "master")
154
+ result = git_diff(test_repository, default_branch)
155
156
assert "test.txt" in result
157
assert "feature changes" in result
0 commit comments