Panic on request to unstage lines
- Vorherrschende Sprache
- Rust
- Sterne
- 22.5k
- Forks
- 773
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Any attempt to unstage one or more lines in a staged file results in an unexpected panic.
Steps to reproduce the behavior:
1. Stage a file with changes
2. Select one or more lines in a hunk in the staged file
3. Press `s` to unstage the lines
4. The following is displayed
```
GitUI was close due to an unexpected panic.
Please file an issue on https://github.com/extrawurst/gitui/issues with the following info:
PanicInfo { payload: Any { .. }, message: Some(index out of bounds: the len is 202 but the index is 202), location: Location { file: "asyncgit\\src\\sync\\staging\\mod.rs", line: 42, col: 25 }, can_unwind: true, force_no_backtrace: false }
trace:
0: git_odb_object_data
1:
2: git_odb_object_data
3: git_odb_object_data
4: git_odb_object_data
5: git_odb_object_data
6: git_midx_writer_new
7: git_midx_writer_new
8: git_odb_object_data
9: git_odb_object_data
10:
11:
12:
13:
14:
15:
16:
17:
18: git_midx_writer_new
19: BaseThreadInitThunk
20: RtlUserThreadStart
```
I expected the selected lines to be removed from the hunk in the staged file and a new unstaged version of the file to be shown with a new hunk containing the lines I requested to unstage.
- OS/Distro + Version: Windows 10 version 22H2 (OS Build 19045.4651)
- GitUI Version: gitui 0.26.3 2024-06-02 (95e1d4d)
- Rust version: Rust not installed. gitui binary installed with Chocolatey.
Beitragsleitfaden
Rechercherichtung
Reproduziere die Aktion zum Aufheben des Stagings einer Zeile in GitUI 0.26.3 und beginne bei asyncgit/src/sync/staging/mod.rs Zeile 42, wo der gemeldete Panic wegen eines Zugriffs außerhalb der Indexgrenzen auftritt. Verfolge den Staging-Pfad für ausgewählte Zeilen und überprüfe, dass das Drücken von `s` die ausgewählten Zeilen aus dem gestagten Hunk entfernt und sie ohne Panic in einem neuen nicht gestagten Hunk anzeigt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- git, rust
- Bereich
- cli
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 55/100