{"record":{"id":"609ad75910787158","repo":"nikivdev/code","slug":"repo-url-is-required","errorCode":null,"errorMessage":"repo URL is required","messagePattern":"repo URL is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/home.rs","lineNumber":793,"sourceCode":"        if flat.is_some() {\n            return Ok(flat);\n        }\n    }\n    Ok(None)\n}\n\nfn derive_internal_repo(repo: &RepoInput) -> Option<String> {\n    let suffix = format!(\"{}-i\", repo.repo);\n    match repo.scheme {\n        RepoScheme::Https => Some(format!(\"https://github.com/{}/{}.git\", repo.owner, suffix)),\n        RepoScheme::Ssh => Some(format!(\"git@github.com:{}/{}.git\", repo.owner, suffix)),\n    }\n}\n\nfn parse_repo_input(input: &str) -> Result<RepoInput> {\n    let trimmed = input.trim().trim_end_matches('/');\n    if trimmed.is_empty() {\n        bail!(\"repo URL is required\");\n    }\n\n    if let Some(rest) = trimmed.strip_prefix(\"git@github.com:\") {\n        return parse_owner_repo(rest, RepoScheme::Ssh);\n    }\n\n    if let Some(rest) = trimmed.strip_prefix(\"ssh://git@github.com/\") {\n        return parse_owner_repo(rest, RepoScheme::Ssh);\n    }\n\n    if let Some(rest) = trimmed.strip_prefix(\"https://github.com/\") {\n        return parse_owner_repo(rest, RepoScheme::Https);\n    }\n\n    if let Some(rest) = trimmed.strip_prefix(\"http://github.com/\") {\n        return parse_owner_repo(rest, RepoScheme::Https);\n    }\n","sourceCodeStart":775,"sourceCodeEnd":811,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/home.rs#L775-L811","documentation":"parse_repo_input normalizes user-supplied repo identifiers (SSH scp-style URLs, HTTPS URLs, owner/repo shorthands) into a RepoInput. An empty string (after trimming whitespace and trailing slashes) cannot identify any repository, so it bails with this message.","triggerScenarios":"Calling run, ensure_kar_repo, or coerce_repo_input with an empty/unset repo URL string that reaches parse_repo_input as \"\" or only whitespace/slashes.","commonSituations":"Missing repo_url in home.toml / config; environment variable interpolating to empty; blank CLI argument; read_internal_repo returning None and an empty default being passed through.","solutions":["Set the repo URL in the config (home.toml) or pass it explicitly on the command line","Check that the env var feeding the value is actually set/non-empty","Use owner/repo shorthand, e.g. `owner/repo`, `git@github.com:owner/repo.git`, or an HTTPS URL"],"exampleFix":"// before (home.toml)\nrepo_url = \"\"\n// after\nrepo_url = \"owner/kar\"","handlingStrategy":"validation","validationCode":"let repo_url = std::env::var(\"REPO_URL\")?;\nif repo_url.trim().trim_end_matches('/').is_empty() {\n    bail!(\"REPO_URL must be non-empty (use owner/repo or a GitHub URL)\");\n}","typeGuard":"fn non_empty_repo_input(s: &str) -> Option<&str> {\n    let t = s.trim().trim_end_matches('/');\n    if t.is_empty() { None } else { Some(t) }\n}","tryCatchPattern":"match parse_repo_input(input) {\n    Err(e) if e.to_string() == \"repo URL is required\" => {\n        eprintln!(\"provide --repo owner/name or set repo_url in config\");\n    }\n    r => r?,\n}","preventionTips":["Always set repo_url in home.toml or pass --repo explicitly","Check env vars feeding the value are set and non-empty","Prefer the owner/repo shorthand to avoid format ambiguity"],"tags":["validation","git","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}