Skip to content

Commit 9e1db3d

Browse files
author
Stephan Dilly
committed
fix naming
1 parent 3bd01b3 commit 9e1db3d

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/components/stashmsg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl Component for StashMsgComponent {
5757
Some(self.input.get_text().as_str())
5858
},
5959
self.options.stash_untracked,
60-
!self.options.stash_indexed,
60+
self.options.keep_index,
6161
)
6262
.is_ok()
6363
{

src/tabs/stashing.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use tui::{
2626
#[derive(Default, Clone, Copy)]
2727
pub struct StashingOptions {
2828
pub stash_untracked: bool,
29-
pub stash_indexed: bool,
29+
pub keep_index: bool,
3030
}
3131

3232
pub struct Stashing {
@@ -56,7 +56,7 @@ impl Stashing {
5656
),
5757
visible: false,
5858
options: StashingOptions {
59-
stash_indexed: true,
59+
keep_index: false,
6060
stash_untracked: true,
6161
},
6262
theme: *theme,
@@ -67,15 +67,9 @@ impl Stashing {
6767

6868
///
6969
pub fn update(&mut self) {
70-
let status_type = if self.options.stash_indexed {
71-
StatusType::Both
72-
} else {
73-
StatusType::WorkingDir
74-
};
75-
7670
self.git_status
7771
.fetch(StatusParams::new(
78-
status_type,
72+
StatusType::Both,
7973
self.options.stash_untracked,
8074
))
8175
.unwrap();
@@ -115,13 +109,13 @@ impl Stashing {
115109
bracket_close.clone(),
116110
Text::Raw(Cow::from(" stash untracked\n")),
117111
bracket_open,
118-
if self.options.stash_indexed {
112+
if self.options.keep_index {
119113
option_on.clone()
120114
} else {
121115
option_off.clone()
122116
},
123117
bracket_close,
124-
Text::Raw(Cow::from(" stash staged")),
118+
Text::Raw(Cow::from(" keep index")),
125119
]
126120
}
127121
}
@@ -206,8 +200,8 @@ impl Component for Stashing {
206200
true
207201
}
208202
keys::STASHING_TOGGLE_INDEX => {
209-
self.options.stash_indexed =
210-
!self.options.stash_indexed;
203+
self.options.keep_index =
204+
!self.options.keep_index;
211205
self.update();
212206
true
213207
}

0 commit comments

Comments
 (0)