Skip to content

Add popup for file history #841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jan 30, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify test
  • Loading branch information
cruessler committed Jan 30, 2022
commit 96ab199efea3a58d064bf4455c8dc79bffbb1b59
22 changes: 5 additions & 17 deletions asyncgit/src/sync/logwalker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ mod tests {
use crate::error::Result;
use crate::sync::RepoPath;
use crate::sync::{
commit, commit_files::get_commit_diff, get_commits_info,
stage_add_file, tests::repo_init_empty,
commit, get_commits_info, stage_add_file,
tests::repo_init_empty,
};
use pretty_assertions::assert_eq;
use std::{fs::File, io::Write, path::Path};
Expand Down Expand Up @@ -225,24 +225,12 @@ mod tests {
let _third_commit_id = commit(&repo_path, "commit3").unwrap();

let repo_path_clone = repo_path.clone();
let diff_contains_baz = move |repo: &Repository,
commit_id: &CommitId|
-> Result<bool> {
let diff = get_commit_diff(
&repo_path_clone,
&repo,
*commit_id,
Some("baz".into()),
)?;

let contains_file = diff.deltas().len() > 0;

Ok(contains_file)
};
let diff_contains_baz =
diff_contains_file(repo_path_clone, "baz".into());

let mut items = Vec::new();
let mut walker = LogWalker::new(&repo, 100)?
.filter(Some(Arc::new(Box::new(diff_contains_baz))));
.filter(Some(diff_contains_baz));
walker.read(&mut items).unwrap();

assert_eq!(items.len(), 1);
Expand Down