Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions merge-ort.c
Original file line number Diff line number Diff line change
Expand Up @@ -3292,6 +3292,13 @@ static int collect_renames(struct merge_options *opt,
continue;
}

if (opt->detect_directory_renames == MERGE_DIRECTORY_RENAMES_NONE &&
p->status == 'R') {
possibly_cache_new_pair(renames, p, side_index, NULL);
pool_diff_free_filepair(&opt->priv->pool, p);
continue;
}

new_path = check_for_directory_rename(opt, p->two->path,
side_index,
dir_renames_for_side,
Expand Down
22 changes: 22 additions & 0 deletions t/t3650-replay-basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,26 @@ test_expect_success 'using replay on bare repo to rebase multiple divergent bran
done
'

test_expect_success 'merge.directoryRenames=false' '
# create a test case that stress-tests the rename caching
git switch -c rename-onto &&

mkdir -p to-rename &&
test_commit to-rename/move &&

mkdir -p renamed-directory &&
git mv to-rename/move* renamed-directory/ &&
test_tick &&
git commit -m renamed-directory &&

git switch -c rename-from HEAD^ &&
test_commit to-rename/add-a-file &&
echo modified >to-rename/add-a-file.t &&
test_tick &&
git commit -m modified to-rename/add-a-file.t &&

git -c merge.directoryRenames=false replay \
--onto rename-onto rename-onto..rename-from
'

Comment on lines +198 to +219
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case is identical to the one over here.

test_done