File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
datajunction_server/internal Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments