@@ -1073,46 +1073,63 @@ def get_hello_txt_from_repo() -> str:
10731073 assert isinstance (blob , Blob )
10741074 return blob .data .decode ()
10751075
1076- # no change
1077- res = testrepo .merge_file_from_index (hello_txt , hello_txt , hello_txt )
1078- assert res == get_hello_txt_from_repo ()
1076+ with pytest .warns (DeprecationWarning , match = 'Getting an str' ):
1077+ # no change
1078+ res = testrepo .merge_file_from_index (
1079+ hello_txt , hello_txt , hello_txt , use_deprecated = True
1080+ )
1081+ assert res == get_hello_txt_from_repo ()
10791082
1080- # executable switch on ours
1081- res = testrepo .merge_file_from_index (hello_txt , hello_txt_executable , hello_txt )
1082- assert res == get_hello_txt_from_repo ()
1083+ # executable switch on ours
1084+ res = testrepo .merge_file_from_index (
1085+ hello_txt , hello_txt_executable , hello_txt , use_deprecated = True
1086+ )
1087+ assert res == get_hello_txt_from_repo ()
10831088
1084- # executable switch on theirs
1085- res = testrepo .merge_file_from_index (hello_txt , hello_txt , hello_txt_executable )
1086- assert res == get_hello_txt_from_repo ()
1089+ # executable switch on theirs
1090+ res = testrepo .merge_file_from_index (
1091+ hello_txt , hello_txt , hello_txt_executable , use_deprecated = True
1092+ )
1093+ assert res == get_hello_txt_from_repo ()
10871094
1088- # executable switch on both
1089- res = testrepo .merge_file_from_index (
1090- hello_txt , hello_txt_executable , hello_txt_executable
1091- )
1092- assert res == get_hello_txt_from_repo ()
1095+ # executable switch on both
1096+ res = testrepo .merge_file_from_index (
1097+ hello_txt , hello_txt_executable , hello_txt_executable , use_deprecated = True
1098+ )
1099+ assert res == get_hello_txt_from_repo ()
10931100
1094- # path switch on ours
1095- res = testrepo .merge_file_from_index (hello_txt , hello_world , hello_txt )
1096- assert res == get_hello_txt_from_repo ()
1101+ # path switch on ours
1102+ res = testrepo .merge_file_from_index (
1103+ hello_txt , hello_world , hello_txt , use_deprecated = True
1104+ )
1105+ assert res == get_hello_txt_from_repo ()
10971106
1098- # path switch on theirs
1099- res = testrepo .merge_file_from_index (hello_txt , hello_txt , hello_world )
1100- assert res == get_hello_txt_from_repo ()
1107+ # path switch on theirs
1108+ res = testrepo .merge_file_from_index (
1109+ hello_txt , hello_txt , hello_world , use_deprecated = True
1110+ )
1111+ assert res == get_hello_txt_from_repo ()
11011112
1102- # path switch on both
1103- res = testrepo .merge_file_from_index (hello_txt , hello_world , hello_world )
1104- assert res == get_hello_txt_from_repo ()
1113+ # path switch on both
1114+ res = testrepo .merge_file_from_index (
1115+ hello_txt , hello_world , hello_world , use_deprecated = True
1116+ )
1117+ assert res == get_hello_txt_from_repo ()
11051118
1106- # path switch on ours, executable flag switch on theirs
1107- res = testrepo .merge_file_from_index (hello_txt , hello_world , hello_txt_executable )
1108- assert res == get_hello_txt_from_repo ()
1119+ # path switch on ours, executable flag switch on theirs
1120+ res = testrepo .merge_file_from_index (
1121+ hello_txt , hello_world , hello_txt_executable , use_deprecated = True
1122+ )
1123+ assert res == get_hello_txt_from_repo ()
11091124
1110- # path switch on theirs, executable flag switch on ours
1111- res = testrepo .merge_file_from_index (hello_txt , hello_txt_executable , hello_world )
1112- assert res == get_hello_txt_from_repo ()
1125+ # path switch on theirs, executable flag switch on ours
1126+ res = testrepo .merge_file_from_index (
1127+ hello_txt , hello_txt_executable , hello_world , use_deprecated = True
1128+ )
1129+ assert res == get_hello_txt_from_repo ()
11131130
11141131
1115- def test_merge_file_from_index_non_deprecated (testrepo : Repository ) -> None :
1132+ def test_merge_file_from_index (testrepo : Repository ) -> None :
11161133 hello_txt = testrepo .index ['hello.txt' ]
11171134 hello_txt_executable = IndexEntry (
11181135 hello_txt .path , hello_txt .id , FileMode .BLOB_EXECUTABLE
@@ -1126,15 +1143,15 @@ def get_hello_txt_from_repo() -> str:
11261143
11271144 # no change
11281145 res = testrepo .merge_file_from_index (
1129- hello_txt , hello_txt , hello_txt , use_deprecated = False
1146+ hello_txt , hello_txt , hello_txt
11301147 )
11311148 assert res == MergeFileResult (
11321149 True , hello_txt .path , hello_txt .mode , get_hello_txt_from_repo ()
11331150 )
11341151
11351152 # executable switch on ours
11361153 res = testrepo .merge_file_from_index (
1137- hello_txt , hello_txt_executable , hello_txt , use_deprecated = False
1154+ hello_txt , hello_txt_executable , hello_txt
11381155 )
11391156 assert res == MergeFileResult (
11401157 True ,
@@ -1145,7 +1162,7 @@ def get_hello_txt_from_repo() -> str:
11451162
11461163 # executable switch on theirs
11471164 res = testrepo .merge_file_from_index (
1148- hello_txt , hello_txt , hello_txt_executable , use_deprecated = False
1165+ hello_txt , hello_txt , hello_txt_executable
11491166 )
11501167 assert res == MergeFileResult (
11511168 True ,
@@ -1156,7 +1173,7 @@ def get_hello_txt_from_repo() -> str:
11561173
11571174 # executable switch on both
11581175 res = testrepo .merge_file_from_index (
1159- hello_txt , hello_txt_executable , hello_txt_executable , use_deprecated = False
1176+ hello_txt , hello_txt_executable , hello_txt_executable
11601177 )
11611178 assert res == MergeFileResult (
11621179 True ,
@@ -1167,29 +1184,29 @@ def get_hello_txt_from_repo() -> str:
11671184
11681185 # path switch on ours
11691186 res = testrepo .merge_file_from_index (
1170- hello_txt , hello_world , hello_txt , use_deprecated = False
1187+ hello_txt , hello_world , hello_txt
11711188 )
11721189 assert res == MergeFileResult (
11731190 True , hello_world .path , hello_txt .mode , get_hello_txt_from_repo ()
11741191 )
11751192
11761193 # path switch on theirs
11771194 res = testrepo .merge_file_from_index (
1178- hello_txt , hello_txt , hello_world , use_deprecated = False
1195+ hello_txt , hello_txt , hello_world
11791196 )
11801197 assert res == MergeFileResult (
11811198 True , hello_world .path , hello_txt .mode , get_hello_txt_from_repo ()
11821199 )
11831200
11841201 # path switch on both
11851202 res = testrepo .merge_file_from_index (
1186- hello_txt , hello_world , hello_world , use_deprecated = False
1203+ hello_txt , hello_world , hello_world
11871204 )
11881205 assert res == MergeFileResult (True , None , hello_txt .mode , get_hello_txt_from_repo ())
11891206
11901207 # path switch on ours, executable flag switch on theirs
11911208 res = testrepo .merge_file_from_index (
1192- hello_txt , hello_world , hello_txt_executable , use_deprecated = False
1209+ hello_txt , hello_world , hello_txt_executable
11931210 )
11941211 assert res == MergeFileResult (
11951212 True ,
@@ -1200,7 +1217,7 @@ def get_hello_txt_from_repo() -> str:
12001217
12011218 # path switch on theirs, executable flag switch on ours
12021219 res = testrepo .merge_file_from_index (
1203- hello_txt , hello_txt_executable , hello_world , use_deprecated = False
1220+ hello_txt , hello_txt_executable , hello_world
12041221 )
12051222 assert res == MergeFileResult (
12061223 True ,
0 commit comments