Skip to content

Commit 8c3385b

Browse files
committed
tests(git[cmd]) Assert behavior of bare=True
1 parent 2ce713a commit 8c3385b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/cmd/test_git.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ def test_git_init_bare(tmp_path: pathlib.Path) -> None:
3434
repo = git.Git(path=tmp_path)
3535
result = repo.init(bare=True)
3636
assert "Initialized empty Git repository" in result
37-
# Bare repos have files directly in the directory
37+
38+
# Verify bare repository structure and configuration
3839
assert (tmp_path / "HEAD").exists()
40+
config_path = tmp_path / "config"
41+
assert config_path.exists(), "Config file does not exist in bare repository"
42+
config_text = config_path.read_text()
43+
assert "bare = true" in config_text, "Repository core.bare flag not set to true"
3944

4045

4146
def test_git_init_template(tmp_path: pathlib.Path) -> None:

0 commit comments

Comments
 (0)