diff --git a/README.md b/README.md index 5bc310e4..0126630b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/app.rs b/src/app.rs index ce202c3c..11ba65fd 100644 --- a/src/app.rs +++ b/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"); + } } } diff --git a/src/git_status.rs b/src/git_status.rs index 67448f09..7d4e5eaf 100644 --- a/src/git_status.rs +++ b/src/git_status.rs @@ -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();