Skip to content

Commit 848a856

Browse files
newrengitster
authored andcommitted
t6423: add more details about direct resolution of directories
Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fd15863 commit 848a856

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

t/t6423-merge-rename-directories.sh

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4725,20 +4725,22 @@ test_expect_success '12e: Rename/merge subdir into the root, variant 2' '
47254725
# folder/subdir/newsubdir/e_Merge2
47264726
# folder/subdir/tweaked/{h,Makefile_SUB_Merge1,newfile.py}
47274727
# folder/unchanged/<LOTS OF FILES>
4728-
#
4729-
# Notes: This testcase happens to exercise lots of the
4730-
# optimization-specific codepaths in merge-ort, and also
4731-
# demonstrated a failing of the directory rename detection algorithm
4732-
# in merge-recursive; newfile.c should not get pushed into
4733-
# folder/subdir/newsubdir/, yet merge-recursive put it there because
4734-
# the rename of dir/subdir/{a,b,c,d} -> folder/subdir/{a,b,c,d}
4735-
# looks like
4736-
# dir/ -> folder/,
4737-
# whereas the rename of dir/subdir/e -> folder/subdir/newsubdir/e
4738-
# looks like
4739-
# dir/subdir/ -> folder/subdir/newsubdir/
4740-
# and if we note that newfile.c is found in dir/subdir/, we might
4741-
# overlook the dir/ -> folder/ rule that has more weight.
4728+
# Things being checked here:
4729+
# 1. dir/subdir/newfile.c does not get pushed into folder/subdir/newsubdir/.
4730+
# dir/subdir/{a,b,c,d} -> folder/subdir/{a,b,c,d} looks like
4731+
# dir/ -> folder/,
4732+
# whereas dir/subdir/e -> folder/subdir/newsubdir/e looks like
4733+
# dir/subdir/ -> folder/subdir/newsubdir/
4734+
# and if we note that newfile.c is found in dir/subdir/, we might overlook
4735+
# the dir/ -> folder/ rule that has more weight. Older git versions did
4736+
# this.
4737+
# 2. The code to do trivial directory resolves. Note that
4738+
# dir/subdir/unchanged/ is unchanged and can be deleted, and files in the
4739+
# new folder/subdir/unchanged/ are not needed as a target to any renames.
4740+
# Thus, in the second collect_merge_info_callback() we can just resolve
4741+
# these two directories trivially without recursing.)
4742+
# 3. Exercising the codepaths for caching renames and deletes from one cherry
4743+
# pick and re-applying them in the subsequent one.
47424744

47434745
test_setup_12f () {
47444746
test_create_repo 12f &&
@@ -4803,7 +4805,7 @@ test_expect_merge_algorithm failure success '12f: Trivial directory resolve, cac
48034805
git checkout A^0 &&
48044806
git branch Bmod B &&
48054807
4806-
git -c merge.directoryRenames=true rebase A Bmod &&
4808+
GIT_TRACE2_PERF="$(pwd)/trace.output" git -c merge.directoryRenames=true rebase A Bmod &&
48074809
48084810
echo Checking the pick of B1... &&
48094811
@@ -4884,7 +4886,12 @@ test_expect_merge_algorithm failure success '12f: Trivial directory resolve, cac
48844886
test_seq 2 12 >e_Merge2 &&
48854887
git hash-object e_Merge2 >expect &&
48864888
git rev-parse Bmod:folder/subdir/newsubdir/e >actual &&
4887-
test_cmp expect actual
4889+
test_cmp expect actual &&
4890+
4891+
grep region_enter.*collect_merge_info trace.output >collect &&
4892+
test_line_count = 4 collect &&
4893+
grep region_enter.*process_entries$ trace.output >process &&
4894+
test_line_count = 2 process
48884895
)
48894896
'
48904897

0 commit comments

Comments
 (0)