@@ -1048,6 +1048,86 @@ fn test_resolve_conflicts_with_executable() {
1048
1048
file1 2-sided conflict including an executable
1049
1049
[EOF]
1050
1050
" ) ;
1051
+
1052
+ // Pick "our" contents, but merges executable bits
1053
+ work_dir. run_jj ( [ "undo" ] ) . success ( ) ;
1054
+ let output = work_dir. run_jj ( [ "resolve" , "--tool=:ours" ] ) ;
1055
+ insta:: assert_snapshot!( output, @r"
1056
+ ------- stderr -------
1057
+ Working copy (@) now at: znkkpsqq 5b59d7f0 conflict | conflict
1058
+ Parent commit (@-) : mzvwutvl 08932848 a | a
1059
+ Parent commit (@-) : yqosqzyt b69b3de6 b | b
1060
+ Added 0 files, modified 2 files, removed 0 files
1061
+ [EOF]
1062
+ " ) ;
1063
+ insta:: assert_snapshot!( work_dir. run_jj( [ "diff" , "--git" ] ) , @r"
1064
+ diff --git a/file1 b/file1
1065
+ index 0000000000..da0f8ed91a 100755
1066
+ --- a/file1
1067
+ +++ b/file1
1068
+ @@ -1,7 +1,1 @@
1069
+ -<<<<<<< Conflict 1 of 1
1070
+ -%%%%%%% Changes from base to side #1
1071
+ --base1
1072
+ -+a1
1073
+ -+++++++ Contents of side #2
1074
+ -b1
1075
+ ->>>>>>> Conflict 1 of 1 ends
1076
+ +a1
1077
+ diff --git a/file2 b/file2
1078
+ index 0000000000..c1827f07e1 100755
1079
+ --- a/file2
1080
+ +++ b/file2
1081
+ @@ -1,7 +1,1 @@
1082
+ -<<<<<<< Conflict 1 of 1
1083
+ -%%%%%%% Changes from base to side #1
1084
+ --base2
1085
+ -+a2
1086
+ -+++++++ Contents of side #2
1087
+ -b2
1088
+ ->>>>>>> Conflict 1 of 1 ends
1089
+ +a2
1090
+ [EOF]
1091
+ " ) ;
1092
+
1093
+ // Pick "their" contents, but merges executable bits
1094
+ work_dir. run_jj ( [ "undo" ] ) . success ( ) ;
1095
+ let output = work_dir. run_jj ( [ "resolve" , "--tool=:theirs" ] ) ;
1096
+ insta:: assert_snapshot!( output, @r"
1097
+ ------- stderr -------
1098
+ Working copy (@) now at: znkkpsqq 087b8637 conflict | conflict
1099
+ Parent commit (@-) : mzvwutvl 08932848 a | a
1100
+ Parent commit (@-) : yqosqzyt b69b3de6 b | b
1101
+ Added 0 files, modified 2 files, removed 0 files
1102
+ [EOF]
1103
+ " ) ;
1104
+ insta:: assert_snapshot!( work_dir. run_jj( [ "diff" , "--git" ] ) , @r"
1105
+ diff --git a/file1 b/file1
1106
+ index 0000000000..c9c6af7f78 100755
1107
+ --- a/file1
1108
+ +++ b/file1
1109
+ @@ -1,7 +1,1 @@
1110
+ -<<<<<<< Conflict 1 of 1
1111
+ -%%%%%%% Changes from base to side #1
1112
+ --base1
1113
+ -+a1
1114
+ -+++++++ Contents of side #2
1115
+ b1
1116
+ ->>>>>>> Conflict 1 of 1 ends
1117
+ diff --git a/file2 b/file2
1118
+ index 0000000000..e6bfff5c1d 100755
1119
+ --- a/file2
1120
+ +++ b/file2
1121
+ @@ -1,7 +1,1 @@
1122
+ -<<<<<<< Conflict 1 of 1
1123
+ -%%%%%%% Changes from base to side #1
1124
+ --base2
1125
+ -+a2
1126
+ -+++++++ Contents of side #2
1127
+ b2
1128
+ ->>>>>>> Conflict 1 of 1 ends
1129
+ [EOF]
1130
+ " ) ;
1051
1131
}
1052
1132
1053
1133
#[ test]
@@ -1213,7 +1293,19 @@ fn test_resolve_change_delete_executable() {
1213
1293
insta:: assert_snapshot!( output, @"" ) ;
1214
1294
std:: fs:: write ( & editor_script, "write\n resolved\n " ) . unwrap ( ) ;
1215
1295
let output = work_dir. run_jj ( [ "resolve" , "file2" ] ) ;
1216
- assert_eq ! ( output. status. code( ) , Some ( 101 ) ) ; // FIXME
1296
+ insta:: assert_snapshot!( output, @r"
1297
+ ------- stderr -------
1298
+ Resolving conflicts in: file2
1299
+ Working copy (@) now at: kmkuslsw cab8be9b conflict | (conflict) conflict
1300
+ Parent commit (@-) : mzvwutvl 4a44e1a9 a | a
1301
+ Parent commit (@-) : vruxwmqv 19e7d2ff b | b
1302
+ Added 0 files, modified 1 files, removed 0 files
1303
+ Warning: There are unresolved conflicts at these paths:
1304
+ file3 2-sided conflict including an executable
1305
+ file4 2-sided conflict including 1 deletion
1306
+ file5 2-sided conflict including 1 deletion and an executable
1307
+ [EOF]
1308
+ " ) ;
1217
1309
1218
1310
// Exec bit conflict can be resolved by chmod
1219
1311
let output = work_dir. run_jj ( [ "resolve" , "file3" ] ) ;
@@ -1233,17 +1325,34 @@ fn test_resolve_change_delete_executable() {
1233
1325
1234
1326
// Take modified content, the executable bit should be kept as "-"
1235
1327
let output = work_dir. run_jj ( [ "resolve" , "file4" , "--tool=:ours" ] ) ;
1236
- assert_eq ! ( output. status. code( ) , Some ( 101 ) ) ; // FIXME
1328
+ insta:: assert_snapshot!( output, @r"
1329
+ ------- stderr -------
1330
+ Working copy (@) now at: kmkuslsw 14b5c3d2 conflict | (conflict) conflict
1331
+ Parent commit (@-) : mzvwutvl 4a44e1a9 a | a
1332
+ Parent commit (@-) : vruxwmqv 19e7d2ff b | b
1333
+ Added 0 files, modified 1 files, removed 0 files
1334
+ Warning: There are unresolved conflicts at these paths:
1335
+ file5 2-sided conflict including 1 deletion and an executable
1336
+ [EOF]
1337
+ " ) ;
1237
1338
1238
1339
// Take modified content, the executable bit should be kept as "x"
1239
1340
let output = work_dir. run_jj ( [ "resolve" , "file5" , "--tool=:theirs" ] ) ;
1240
- assert_eq ! ( output. status. code( ) , Some ( 101 ) ) ; // FIXME
1341
+ insta:: assert_snapshot!( output, @r"
1342
+ ------- stderr -------
1343
+ Working copy (@) now at: kmkuslsw 5de68577 conflict | conflict
1344
+ Parent commit (@-) : mzvwutvl 4a44e1a9 a | a
1345
+ Parent commit (@-) : vruxwmqv 19e7d2ff b | b
1346
+ Added 0 files, modified 1 files, removed 0 files
1347
+ Existing conflicts were resolved or abandoned from 1 commits.
1348
+ [EOF]
1349
+ " ) ;
1241
1350
1242
1351
insta:: assert_snapshot!( file_list( "all()" ) , @r"
1243
- file2 c -
1352
+ file2 - -
1244
1353
file3 - x
1245
- file4 c -
1246
- file5 c x
1354
+ file4 - -
1355
+ file5 - x
1247
1356
[EOF]
1248
1357
" ) ;
1249
1358
}
0 commit comments