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] show added files on working dir changes
|
||||||
* [x] support committing
|
* [x] support committing
|
||||||
* [x] popup centered
|
* [x] popup centered
|
||||||
* [ ] crash: adding a pic to index crashes
|
|
||||||
* [ ] crash: renamed files cannot be added to index
|
* [ ] crash: renamed files cannot be added to index
|
||||||
* [ ] allow selecting/diff index items
|
* [ ] allow selecting/diff index items
|
||||||
* [ ] support unstaging
|
* [ ] support unstaging
|
||||||
|
|
|
||||||
12
src/app.rs
12
src/app.rs
|
|
@ -270,10 +270,14 @@ impl App {
|
||||||
let mut index = repo.index().unwrap();
|
let mut index = repo.index().unwrap();
|
||||||
|
|
||||||
let path = Path::new(self.status.wt_items[i].path.as_str());
|
let path = Path::new(self.status.wt_items[i].path.as_str());
|
||||||
index.add_path(path).unwrap();
|
if path.is_file() {
|
||||||
index.write().unwrap();
|
if let Ok(_) = index.add_path(path) {
|
||||||
|
index.write().unwrap();
|
||||||
self.update();
|
self.update();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unimplemented!("can only add files");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,10 @@ impl StatusLists {
|
||||||
|
|
||||||
let statuses = repo
|
let statuses = repo
|
||||||
.statuses(Some(
|
.statuses(Some(
|
||||||
StatusOptions::default().show(show).include_untracked(true),
|
StatusOptions::default()
|
||||||
|
.show(show)
|
||||||
|
.include_untracked(true)
|
||||||
|
.recurse_untracked_dirs(true),
|
||||||
))
|
))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue