← Back to Pull requests

LibGit2: Fix issues reported by JETLS #65180

Closed
unknown closed this pull request without merging on Nov 24, 2026 00:33 UTC
View on GitHub
unknown unknown commented on Nov 23, 2026 07:10 UTC
Author

Use JETLS to improve the code quality of LibGit2. With these changes, jetls check stdlib/LibGit2 reports no diagnostics for the package source other than hints for the inactive @static branches and the abstractly typed fields, such as the Any fields that hold callback payloads.

  • Make push(::GitRemote, refspecs; force=true), which LibGit2.push(::GitRepo; force=true) calls, force the push. The force keyword argument has been ignored since it was added, so a push that is not a fast-forward failed with ENONFASTFORWARD even with force=true. libgit2 forces the update of a remote reference by a leading + in the refspec, so add it to the given refspecs, or to the configured push refspecs when none are given

  • Throw an ArgumentError from credential_identifier, which approve and reject call for CachedCredentials, for a URL that cannot be parsed, instead of a MethodError for getindex(::Nothing, ::Symbol)

  • Remove the unused import of SHA and the dependency on it, also from the entries of LibGit2 in the manifests in this repository. #39324 replaced the comparison of the hashes of known SSH host keys with libssh2_knownhost_checkp, and nothing has used sha1 or sha256 since then

  • Read GitCredential.password, GitIndex.owner and the host capture in ismatch into local variables before checking them for nothing, so that inference can narrow their types. In read!(::IO, ::GitCredential), check for the password key before reading the field, instead of reading the field named by any key

  • Assert with something that the branch name captured from the reference of an orphan HEAD in merge! is not nothing

  • Declare new_branch_ref in branch! and commit_id in commit with local, instead of assigning initial values that are never used

  • Avoid some of the boxed variables that closures capture in the tests: declare url in gen_ex of the SSH credential prompt tests and repo_url in the hostname verification test with local instead of assigning to the variables of the enclosing scope, and stop reusing path for the bare repositories in the bare testset

  • Assert with something that the results of match, lookup_branch, lookup_remote and status are not nothing before the tests use them, and remove the unused variables in the tests

  • Prefix the names of unused arguments and variables with _, or replace them with _ where the names tell nothing, and sort the names in the import, using and export lists
  • Assisted-by: Claude Code (Opus 5.5)

    Diff: 317 lines (+237 / -80) across 3 files Reviewer: KristofferC Review duration: 1042m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.64) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.64 · 317 lines diff across 3 files
    0.64
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.345
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.064
    Real PR Conversation Timeline
    1 comments
    "Review active on #65180"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 63.6% (MEDIUM) · Higher = larger blast radius
    63.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.1% · Safe to merge
    25.1%