{"record":{"id":"ab84838bdc08ec0a","repo":"Morganamilo/paru","slug":"devel","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/devel.rs","lineNumber":275,"sourceCode":"    branch: Option<&str>,\n) -> Result<String> {\n    #[cfg(feature = \"mock\")]\n    let _ = git;\n    #[cfg(feature = \"mock\")]\n    let git = \"git\";\n\n    let mut command = AsyncCommand::new(git);\n    command\n        .args(flags)\n        .env(\"GIT_TERMINAL_PROMPT\", \"0\")\n        .arg(\"ls-remote\")\n        .arg(remote)\n        .arg(branch.unwrap_or(\"HEAD\"));\n\n    debug!(\"git ls-remote {} {}\", remote, branch.unwrap_or(\"HEAD\"));\n    let output = command.output().await?;\n    if !output.status.success() {\n        bail!(\"{}\", String::from_utf8_lossy(&output.stderr));\n    }\n\n    let sha = String::from_utf8_lossy(&output.stdout)\n        .split('\\t')\n        .next()\n        .unwrap()\n        .to_string();\n\n    Ok(sha)\n}\n\nasync fn ls_remote(\n    style: Style,\n    git: &str,\n    flags: &[String],\n    remote: String,\n    branch: Option<&str>,\n) -> Result<String> {","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/devel.rs#L257-L293","documentation":"In src/devel.rs:275 (ls_remote_internal), the crate shells out to `git ls-remote <remote> <branch|HEAD>` to resolve a VCS package's latest commit. If git exits non-zero, the raw stderr text is propagated as the error via `bail!(\"{}\", ...)`. The message is exactly git's own output (e.g. \"fatal: could not read from remote repository\"), so the thrown message content varies with what git printed.","triggerScenarios":"Any non-zero exit of `git ls-remote` during devel (VCS) package update checks: the remote URL is unreachable, the repository was deleted or renamed, the branch/ref no longer exists, SSH keys/passphrases are missing, or network/DNS fails.","commonSituations":"Checking AUR -git/-svn/-hg packages after upstream repo moved to a different host; offline or behind a proxy/firewall; SSH deploy key not configured for a private repo; branch renamed upstream so `HEAD`/branch arg fails.","solutions":["Run `git ls-remote <url>` manually to see the underlying git error and fix connectivity/credentials it reports.","Verify the package's source URL in its PKGBUILD still points to a live repository and branch; update the package or its URL if upstream moved.","Check SSH keys / HTTPS tokens (`ssh -T git@host`, `git credential fill`) if the failure is authentication-related.","If the VCS package is abandoned, remove it or switch to a maintained fork's package."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Probe reachability/credentials before the update sweep\nlet ok = std::process::Command::new(\"git\")\n    .args([\"ls-remote\", \"--exit-code\", remote])\n    .output()\n    .map(|o| o.status.success())\n    .unwrap_or(false);\nif !ok { eprintln!(\"skipping {remote}: unreachable\"); }","typeGuard":null,"tryCatchPattern":"match ls_remote(&pkg).await {\n    Ok(info) => use(info),\n    Err(e) => {\n        // stderr from git ls-remote is embedded in the message\n        eprintln!(\"devel check failed for {}: {e}\", pkg.name);\n        eprintln!(\"hint: run `git ls-remote <url>` to see the raw git error\");\n        // continue with remaining packages instead of aborting the sweep\n    }\n}","preventionTips":["Keep SSH keys / HTTPS tokens configured and test with `ssh -T git@host` or `git ls-remote`.","Check that the package's PKGBUILD source URL is still live before the update run.","Handle offline state: preflight a cheap network check and skip devel updates when offline.","Update or orphan VCS packages whose upstream repo was renamed or deleted."],"tags":["git","network","vcs","devel-package"],"backgroundTag":"git-command-failed","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}