pub fn resolve_backend(
parsed_input: &ParsedInput,
allow_user_repo_fetch: bool,
) -> WtgResult<Box<dyn Backend>>Expand description
Resolve the best backend based on available resources.
§Arguments
parsed_input- The parsed user inputallow_user_repo_fetch- If true, allow fetching into user’s local repo
Decision tree:
- Explicit repo info provided → Use cached/cloned repo + GitHub API (hard error if GitHub client fails)
- In local repo with GitHub remote → Combined backend (soft notice if GitHub client fails)
- In local repo without GitHub remote → Git-only backend with appropriate notice
- Not in repo and no info → Error