async def test_clone_or_init_repo_no_repo_no_user_id_no_workspace_base(temp_dir):
    """Test that git init is run when no repository is selected, no user_id, and no workspace_base"""
    config = OpenHandsConfig()
    config.workspace_base = None  # Ensure workspace_base is not set
    file_store = get_file_store('local', temp_dir)
    event_stream = EventStream('abc', file_store)
    runtime = TestRuntime(
        config=config, event_stream=event_stream, sid='test', user_id=None
    )

    # Call the function with no repository
    result = await runtime.clone_or_init_repo(None, None, None)

    # Verify that git init was called
    assert len(runtime.run_action_calls) == 1
    assert isinstance(runtime.run_action_calls[0], CmdRunAction)
    assert (
        runtime.run_action_calls[0].command
        == f'git init && git config --global --add safe.directory {runtime.workspace_root}'
    )
    assert result == ''
Test that git init is run when no repository is selected, no user_id, and no workspace_base
tests/unit/test_runtime_git_tokens.py