@@ -2078,18 +2078,23 @@ test_expect_success '8b-check: Dual-directory rename, one into the others way, w
2078
2078
)
2079
2079
'
2080
2080
2081
- # Testcase 8c, rename+modify/delete
2082
- # (Related to testcases 5b and 8d )
2081
+ # Testcase 8c, modify/delete or rename+modify/delete?
2082
+ # (Related to testcases 5b, 8d, and 9h )
2083
2083
# Commit O: z/{b,c,d}
2084
2084
# Commit A: y/{b,c}
2085
2085
# Commit B: z/{b,c,d_modified,e}
2086
- # Expected: y/{b,c,e}, CONFLICT(rename+ modify/delete: x/d -> y/d or deleted )
2086
+ # Expected: y/{b,c,e}, CONFLICT(modify/delete: on z/d )
2087
2087
#
2088
- # Note: This testcase doesn't present any concerns for me...until you
2089
- # compare it with testcases 5b and 8d. See notes in 8d for more
2090
- # details.
2091
-
2092
- test_expect_success ' 8c-setup: rename+modify/delete' '
2088
+ # Note: It could easily be argued that the correct resolution here is
2089
+ # y/{b,c,e}, CONFLICT(rename/delete: z/d -> y/d vs deleted)
2090
+ # and that the modifed version of d should be present in y/ after
2091
+ # the merge, just marked as conflicted. Indeed, I previously did
2092
+ # argue that. But applying directory renames to the side of
2093
+ # history where a file is merely modified results in spurious
2094
+ # rename/rename(1to2) conflicts -- see testcase 9h. See also
2095
+ # notes in 8d.
2096
+
2097
+ test_expect_success ' 8c-setup: modify/delete or rename+modify/delete?' '
2093
2098
test_create_repo 8c &&
2094
2099
(
2095
2100
cd 8c &&
@@ -2122,32 +2127,32 @@ test_expect_success '8c-setup: rename+modify/delete' '
2122
2127
)
2123
2128
'
2124
2129
2125
- test_expect_success ' 8c-check: rename+modify/delete' '
2130
+ test_expect_success ' 8c-check: modify/delete or rename+modify/delete' '
2126
2131
(
2127
2132
cd 8c &&
2128
2133
2129
2134
git checkout A^0 &&
2130
2135
2131
2136
test_must_fail git merge -s recursive B^0 >out &&
2132
- test_i18ngrep "CONFLICT (rename /delete).* z/d.*y /d" out &&
2137
+ test_i18ngrep "CONFLICT (modify /delete).* z/d" out &&
2133
2138
2134
2139
git ls-files -s >out &&
2135
- test_line_count = 4 out &&
2140
+ test_line_count = 5 out &&
2136
2141
git ls-files -u >out &&
2137
- test_line_count = 1 out &&
2142
+ test_line_count = 2 out &&
2138
2143
git ls-files -o >out &&
2139
2144
test_line_count = 1 out &&
2140
2145
2141
2146
git rev-parse >actual \
2142
- :0:y/b :0:y/c :0:y/e :3:y /d &&
2147
+ :0:y/b :0:y/c :0:y/e :1:z/d :3:z /d &&
2143
2148
git rev-parse >expect \
2144
- O:z/b O:z/c B:z/e B:z/d &&
2149
+ O:z/b O:z/c B:z/e O:z/d B:z/d &&
2145
2150
test_cmp expect actual &&
2146
2151
2147
- test_must_fail git rev-parse :1:y /d &&
2148
- test_must_fail git rev-parse :2:y/d &&
2149
- git ls-files -s y/d | grep ^100755 &&
2150
- test_path_is_file y/d
2152
+ test_must_fail git rev-parse :2:z /d &&
2153
+ git ls-files -s z/d | grep ^100755 &&
2154
+ test_path_is_file z/d &&
2155
+ test_path_is_missing y/d
2151
2156
)
2152
2157
'
2153
2158
@@ -2161,16 +2166,6 @@ test_expect_success '8c-check: rename+modify/delete' '
2161
2166
#
2162
2167
# Note: It would also be somewhat reasonable to resolve this as
2163
2168
# y/{b,c,e}, CONFLICT(rename/delete: x/d -> y/d or deleted)
2164
- # The logic being that the only difference between this testcase and 8c
2165
- # is that there is no modification to d. That suggests that instead of a
2166
- # rename/modify vs. delete conflict, we should just have a rename/delete
2167
- # conflict, otherwise we are being inconsistent.
2168
- #
2169
- # However...as far as consistency goes, we didn't report a conflict for
2170
- # path d_1 in testcase 5b due to a different file being in the way. So,
2171
- # we seem to be forced to have cases where users can change things
2172
- # slightly and get what they may perceive as inconsistent results. It
2173
- # would be nice to avoid that, but I'm not sure I see how.
2174
2169
#
2175
2170
# In this case, I'm leaning towards: commit A was the one that deleted z/d
2176
2171
# and it did the rename of z to y, so the two "conflicts" (rename vs.
@@ -2915,7 +2910,7 @@ test_expect_success '9h-setup: Avoid dir rename on merely modified path' '
2915
2910
)
2916
2911
'
2917
2912
2918
- test_expect_failure ' 9h-check: Avoid dir rename on merely modified path' '
2913
+ test_expect_success ' 9h-check: Avoid dir rename on merely modified path' '
2919
2914
(
2920
2915
cd 9h &&
2921
2916
@@ -3959,7 +3954,7 @@ test_expect_success '12c-setup: Moving one directory hierarchy into another w/ c
3959
3954
)
3960
3955
'
3961
3956
3962
- test_expect_failure ' 12c-check: Moving one directory hierarchy into another w/ content merge' '
3957
+ test_expect_success ' 12c-check: Moving one directory hierarchy into another w/ content merge' '
3963
3958
(
3964
3959
cd 12c &&
3965
3960
0 commit comments