Skip to content

Commit aa2d0f5

Browse files
committed
find more renames that git-log --follow would
1 parent 34ebe7b commit aa2d0f5

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

asyncgit/src/sync/commit_files.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,13 @@ pub(crate) fn commit_detect_file_rename(
198198

199199
let mut diff = get_commit_diff(repo, id, None, None, None)?;
200200

201-
diff.find_similar(Some(DiffFindOptions::new().renames(true)))?;
201+
diff.find_similar(Some(
202+
DiffFindOptions::new()
203+
.renames(true)
204+
.renames_from_rewrites(true)
205+
.rename_from_rewrite_threshold(100)
206+
.rewrites(true),
207+
))?;
202208

203209
let current_path = std::path::Path::new(pathspec);
204210

asyncgit/src/sync/commit_filter.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ pub fn diff_contains_file(
3333
//note: only do rename test in case file looks like being added in this commit
3434

3535
// log::info!(
36-
// "edit: [{}] {:?}",
36+
// "edit: [{}] ({:?}) - {}",
3737
// commit_id.get_short_string(),
38-
// delta
38+
// delta,
39+
// &current_file_path
3940
// );
4041

4142
if matches!(delta, git2::Delta::Added) {
@@ -47,7 +48,7 @@ pub fn diff_contains_file(
4748

4849
if let Some(old_name) = rename {
4950
// log::info!(
50-
// "rename: [{}] '{:?}' <- '{:?}'",
51+
// "rename: [{}] {:?} <- {:?}",
5152
// commit_id.get_short_string(),
5253
// current_file_path,
5354
// old_name,

0 commit comments

Comments
 (0)