File tree Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Expand file tree Collapse file tree 2 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,14 @@ impl Stashing {
67
67
68
68
///
69
69
pub fn update ( & mut self ) {
70
- self . git_status
71
- . fetch ( StatusParams :: new (
72
- StatusType :: Both ,
73
- self . options . stash_untracked ,
74
- ) )
75
- . unwrap ( ) ;
70
+ if self . visible {
71
+ self . git_status
72
+ . fetch ( StatusParams :: new (
73
+ StatusType :: Both ,
74
+ self . options . stash_untracked ,
75
+ ) )
76
+ . unwrap ( ) ;
77
+ }
76
78
}
77
79
78
80
///
@@ -228,7 +230,7 @@ impl Component for Stashing {
228
230
}
229
231
230
232
fn show ( & mut self ) {
231
- self . update ( ) ;
232
233
self . visible = true ;
234
+ self . update ( ) ;
233
235
}
234
236
}
Original file line number Diff line number Diff line change @@ -190,13 +190,18 @@ impl Status {
190
190
191
191
///
192
192
pub fn update ( & mut self ) {
193
- self . git_diff . refresh ( ) . unwrap ( ) ;
194
- self . git_status_workdir
195
- . fetch ( StatusParams :: new ( StatusType :: WorkingDir , true ) )
196
- . unwrap ( ) ;
197
- self . git_status_stage
198
- . fetch ( StatusParams :: new ( StatusType :: Stage , true ) )
199
- . unwrap ( ) ;
193
+ if self . is_visible ( ) {
194
+ self . git_diff . refresh ( ) . unwrap ( ) ;
195
+ self . git_status_workdir
196
+ . fetch ( StatusParams :: new (
197
+ StatusType :: WorkingDir ,
198
+ true ,
199
+ ) )
200
+ . unwrap ( ) ;
201
+ self . git_status_stage
202
+ . fetch ( StatusParams :: new ( StatusType :: Stage , true ) )
203
+ . unwrap ( ) ;
204
+ }
200
205
}
201
206
202
207
///
You can’t perform that action at this time.
0 commit comments