Skip to content

🐛 "capacity overflow" with git add -p #1908

@rfwroo

Description

@rfwroo

Hello! Following on from #320, I seem to still be experiencing the issue (or a very similar issue) in 0.18.2.

% delta --version                                                                                                                                                                                                                                                                                                                                                                                             
delta 0.18.2
% RUST_BACKTRACE=1 git add -p                                                                                                                                                                                                                                                                                                                                                                                  
thread 'main' panicked at library/alloc/src/raw_vec.rs:25:5:
capacity overflow
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: alloc::raw_vec::capacity_overflow
   3: alloc::str::<impl str>::repeat
   4: delta::paint::Painter::paint_lines
   5: delta::paint::Painter::paint_zero_line
   6: delta::handlers::hunk::<impl delta::delta::StateMachine>::handle_hunk_line
   7: delta::delta::delta
   8: delta::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.

This seems to happen with any invocation of git add -p or git checkout -p, even with a trivial diff.
Update: this only affects git add -p and git checkout -p (and possibly other commands with -p flags) with certain diffs, see below.
With --no-pager the crash still occurs.

Please let me know if I can provide any more context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions