Skip to content

Commit

Permalink
addresses PR review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
extrawurst committed May 25, 2023
1 parent 4d3811a commit dfd4abe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2844,7 +2844,7 @@ impl Repository {
}
}

///
/// Like `stash_save` but with more options like selective statshing via path patterns.
pub fn stash_save_ext(
&mut self,
opts: Option<&mut StashSaveOptions<'_>>,
Expand Down
19 changes: 5 additions & 14 deletions src/stash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<'a> StashSaveOptions<'a> {
opts
}

///
/// Customize optional `flags` field
pub fn flags(&mut self, flags: Option<StashFlags>) -> &mut Self {
self.flags = flags;
self
Expand Down Expand Up @@ -218,7 +218,6 @@ mod tests {
use crate::test::repo_init;
use crate::{IndexAddOption, Repository, StashFlags, Status};
use std::fs;
use std::io::Write;
use std::path::{Path, PathBuf};

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

let p = Path::new(repo.workdir().unwrap()).join("file_b.txt");
println!("using path {:?}", p);
fs::File::create(&p)
.unwrap()
.write("data".as_bytes())
.unwrap();

fs::write(&p, "data".as_bytes()).unwrap();

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

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

fs::File::create(&p)
.unwrap()
.write("data".as_bytes())
.unwrap();
fs::write(&p, "data".as_bytes()).unwrap();

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

fn create_file(r: &Repository, name: &str, data: &str) -> PathBuf {
let p = Path::new(r.workdir().unwrap()).join(name);
fs::File::create(&p)
.unwrap()
.write(data.as_bytes())
.unwrap();
fs::write(&p, data).unwrap();
p
}

Expand Down

0 comments on commit dfd4abe

Please sign in to comment.