mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
fix crash when trying to add files in new folderq
This commit is contained in:
parent
472bec5db3
commit
ca6650b9de
3 changed files with 12 additions and 6 deletions
|
|
@ -20,7 +20,6 @@ Over the last 2 years my go to GUI tool for this was [fork](https://git-fork.com
|
|||
* [x] show added files on working dir changes
|
||||
* [x] support committing
|
||||
* [x] popup centered
|
||||
* [ ] crash: adding a pic to index crashes
|
||||
* [ ] crash: renamed files cannot be added to index
|
||||
* [ ] allow selecting/diff index items
|
||||
* [ ] support unstaging
|
||||
|
|
|
|||
12
src/app.rs
12
src/app.rs
|
|
@ -270,10 +270,14 @@ impl App {
|
|||
let mut index = repo.index().unwrap();
|
||||
|
||||
let path = Path::new(self.status.wt_items[i].path.as_str());
|
||||
index.add_path(path).unwrap();
|
||||
index.write().unwrap();
|
||||
|
||||
self.update();
|
||||
if path.is_file() {
|
||||
if let Ok(_) = index.add_path(path) {
|
||||
index.write().unwrap();
|
||||
self.update();
|
||||
}
|
||||
} else {
|
||||
unimplemented!("can only add files");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,10 @@ impl StatusLists {
|
|||
|
||||
let statuses = repo
|
||||
.statuses(Some(
|
||||
StatusOptions::default().show(show).include_untracked(true),
|
||||
StatusOptions::default()
|
||||
.show(show)
|
||||
.include_untracked(true)
|
||||
.recurse_untracked_dirs(true),
|
||||
))
|
||||
.unwrap();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue