Skip to content

Commit f81d0d7

Browse files
committed
Fix
1 parent 5b01512 commit f81d0d7

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

datajunction-server/datajunction_server/internal/namespaces.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ def resolve_git_info_from_map(
293293
"path": config_ns.git_path,
294294
"is_default_branch": (
295295
branch is None # root namespace — no branch means it IS the default
296-
or not default_branch # no default configured — assume default
297-
or branch == default_branch
296+
or (default_branch is not None and branch == default_branch)
298297
),
299298
"parent_namespace": branch_ns.parent_namespace if branch_ns else None,
300299
"git_only": config_ns.git_only,

datajunction-server/tests/internal/git/test_validation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,11 @@ async def test_is_default_branch_true_when_no_git_branch(
802802
assert result["is_default_branch"] is True
803803

804804
@pytest.mark.asyncio
805-
async def test_is_default_branch_true_when_no_default_branch(
805+
async def test_is_default_branch_false_when_no_default_branch(
806806
self,
807807
session: AsyncSession,
808808
):
809-
"""git_branch set but default_branch is None → defaults to True."""
809+
"""git_branch set but default_branch is None → is_default_branch is False (unknown)."""
810810
session.add(
811811
NodeNamespace(
812812
namespace="proj",
@@ -826,7 +826,7 @@ async def test_is_default_branch_true_when_no_default_branch(
826826
result = await get_git_info_for_namespace(session, "proj.feature_x")
827827

828828
assert result is not None
829-
assert result["is_default_branch"] is True
829+
assert result["is_default_branch"] is False
830830

831831
# ------------------------------------------------------------------
832832
# parent_namespace

0 commit comments

Comments
 (0)