Skip to content

Commit dfd4abe

Browse files
committed
addresses PR review feedback
1 parent 4d3811a commit dfd4abe

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/repo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2844,7 +2844,7 @@ impl Repository {
28442844
}
28452845
}
28462846

2847-
///
2847+
/// Like `stash_save` but with more options like selective statshing via path patterns.
28482848
pub fn stash_save_ext(
28492849
&mut self,
28502850
opts: Option<&mut StashSaveOptions<'_>>,

src/stash.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<'a> StashSaveOptions<'a> {
3939
opts
4040
}
4141

42-
///
42+
/// Customize optional `flags` field
4343
pub fn flags(&mut self, flags: Option<StashFlags>) -> &mut Self {
4444
self.flags = flags;
4545
self
@@ -218,7 +218,6 @@ mod tests {
218218
use crate::test::repo_init;
219219
use crate::{IndexAddOption, Repository, StashFlags, Status};
220220
use std::fs;
221-
use std::io::Write;
222221
use std::path::{Path, PathBuf};
223222

224223
fn make_stash<C>(next: C)
@@ -230,10 +229,8 @@ mod tests {
230229

231230
let p = Path::new(repo.workdir().unwrap()).join("file_b.txt");
232231
println!("using path {:?}", p);
233-
fs::File::create(&p)
234-
.unwrap()
235-
.write("data".as_bytes())
236-
.unwrap();
232+
233+
fs::write(&p, "data".as_bytes()).unwrap();
237234

238235
let rel_p = Path::new("file_b.txt");
239236
assert!(repo.status_file(&rel_p).unwrap() == Status::WT_NEW);
@@ -303,10 +300,7 @@ mod tests {
303300

304301
let p = Path::new(repo.workdir().unwrap()).join("file_b.txt");
305302

306-
fs::File::create(&p)
307-
.unwrap()
308-
.write("data".as_bytes())
309-
.unwrap();
303+
fs::write(&p, "data".as_bytes()).unwrap();
310304

311305
repo.stash_save2(&signature, None, Some(StashFlags::INCLUDE_UNTRACKED))
312306
.unwrap();
@@ -324,10 +318,7 @@ mod tests {
324318

325319
fn create_file(r: &Repository, name: &str, data: &str) -> PathBuf {
326320
let p = Path::new(r.workdir().unwrap()).join(name);
327-
fs::File::create(&p)
328-
.unwrap()
329-
.write(data.as_bytes())
330-
.unwrap();
321+
fs::write(&p, data).unwrap();
331322
p
332323
}
333324

0 commit comments

Comments
 (0)