mirror of
https://github.com/extrawurst/gitui.git
synced 2024-11-26 12:35:14 +03:00
support staging
This commit is contained in:
parent
4d75e2d9ac
commit
994e274484
@ -9,9 +9,10 @@ terminal ui (tui) frontend for git written in rust
|
||||
* [x] only show diff of selected file
|
||||
* [x] change detection
|
||||
* [x] allow scrolling diff
|
||||
* [x] support staging
|
||||
* [ ] show added files on working dir changes
|
||||
* [ ] allow selecting/diff index items
|
||||
* [ ] support staging/unstaging
|
||||
* [ ] support unstaging
|
||||
* [ ] support committing
|
||||
* [ ] polling in thread
|
||||
* [ ] support push/pull
|
||||
|
14
src/app.rs
14
src/app.rs
@ -160,7 +160,19 @@ impl App {
|
||||
self.fetch_status();
|
||||
}
|
||||
|
||||
fn index_add(&mut self) {}
|
||||
fn index_add(&mut self) {
|
||||
if let Some(i) = self.status_select {
|
||||
let repo = git_utils::repo();
|
||||
|
||||
let mut index = repo.index().unwrap();
|
||||
|
||||
let path = Path::new(self.status.wt_items[i].path.as_str());
|
||||
index.update_all(path, None).unwrap();
|
||||
index.write().unwrap();
|
||||
|
||||
self.update();
|
||||
}
|
||||
}
|
||||
|
||||
fn scroll(&mut self, inc: bool) {
|
||||
if inc {
|
||||
|
Loading…
Reference in New Issue
Block a user