OXYGENHUB

A credential helper that does not read its input is no error e5f8920bc8d0

An erase helper may remove its file and exit without reading stdin;
writing to it then failed with Broken pipe, depending on timing (seen
once in a gate). As Git does, a closed pipe is ignored and the helper is
judged by its exit status.

Closes #115
Author
Andy McCall @andymccall <[email protected]>
via
agent Claude Code <[email protected]> · delegate for changes, until 2026-11-13 19:00Z · key ea5f78160088
When
· 2026-10-17 11:28 UTC
Signature
✔ signed by Claude Code
Hash
e5f8920bc8d0acad095a8d2b3b747481bd148e01456a7505967158dbff1fae8d
Depends on
ff1f62fee654
Depended on by
nothing yet
In bookmarks
carried-not-removed doctor-trust identical-sides keyless-tags main merge-remote-bookmark paths-for-resolutions-and-amend push-notes show-stat subrepo-pin-state
In tags
v0.10.0 v0.11.0 v0.4.4 v0.4.5 v0.4.6 v0.5.0 v0.5.1 v0.6.0 v0.7.0 v0.8.0 v0.9.0
Edits
3 atoms, 0 tree operations, 1 file

Browse the tree at this change

modified crates/oxy-core/src/credentials.rs +10 −2
…
430 unchanged lines
431 431
        .stderr(Stdio::inherit())
432 432
        .spawn()
433 433
        .map_err(|e| format!("running credential helper {helper:?}: {e}"))?;
434 -
    child
434 +
    // A helper need not read what it is told (an `erase` may just remove
435 +
    // its file and exit); as Git does, a closed pipe is no error. Whether
436 +
    // the helper succeeded is its exit status.
437 +
    match child
435 438
        .stdin
436 439
        .take()
437 440
        .expect("piped")
438 441
        .write_all(input.as_bytes())
439 -
        .map_err(|e| format!("credential helper {helper:?}: {e}"))?;
442 +
    {
443 +
        Err(e) if e.kind() != std::io::ErrorKind::BrokenPipe => {
444 +
            return Err(format!("credential helper {helper:?}: {e}"));
445 +
        }
446 +
        _ => {}
447 +
    }
440 448
    let out = child
441 449
        .wait_with_output()
442 450
        .map_err(|e| format!("credential helper {helper:?}: {e}"))?;
…
134 unchanged lines