@@ -220,11 +220,7 @@ void test_checkout_crlf__detect_crlf_autocrlf_true(void)
220
220
221
221
git_checkout_head (g_repo , & opts );
222
222
223
- if (GIT_EOL_NATIVE == GIT_EOL_LF )
224
- check_file_contents ("./crlf/all-lf" , ALL_LF_TEXT_RAW );
225
- else
226
- check_file_contents ("./crlf/all-lf" , ALL_LF_TEXT_AS_CRLF );
227
-
223
+ check_file_contents ("./crlf/all-lf" , ALL_LF_TEXT_AS_CRLF );
228
224
check_file_contents ("./crlf/all-crlf" , ALL_CRLF_TEXT_RAW );
229
225
}
230
226
@@ -238,16 +234,8 @@ void test_checkout_crlf__detect_crlf_autocrlf_true_utf8(void)
238
234
git_repository_set_head (g_repo , "refs/heads/master" );
239
235
git_checkout_head (g_repo , & opts );
240
236
241
- if (GIT_EOL_NATIVE == GIT_EOL_LF )
242
- {
243
- check_file_contents ("./crlf/few-utf8-chars-lf" , FEW_UTF8_LF_RAW );
244
- check_file_contents ("./crlf/many-utf8-chars-lf" , MANY_UTF8_LF_RAW );
245
- }
246
- else
247
- {
248
- check_file_contents ("./crlf/few-utf8-chars-lf" , FEW_UTF8_CRLF_RAW );
249
- check_file_contents ("./crlf/many-utf8-chars-lf" , MANY_UTF8_CRLF_RAW );
250
- }
237
+ check_file_contents ("./crlf/few-utf8-chars-lf" , FEW_UTF8_CRLF_RAW );
238
+ check_file_contents ("./crlf/many-utf8-chars-lf" , MANY_UTF8_CRLF_RAW );
251
239
252
240
check_file_contents ("./crlf/few-utf8-chars-crlf" , FEW_UTF8_CRLF_RAW );
253
241
check_file_contents ("./crlf/many-utf8-chars-crlf" , MANY_UTF8_CRLF_RAW );
@@ -269,10 +257,7 @@ void test_checkout_crlf__autocrlf_true_index_size_is_filtered_size(void)
269
257
270
258
cl_assert ((entry = git_index_get_bypath (index , "all-lf" , 0 )) != NULL );
271
259
272
- if (GIT_EOL_NATIVE == GIT_EOL_LF )
273
- cl_assert_equal_sz (strlen (ALL_LF_TEXT_RAW ), entry -> file_size );
274
- else
275
- cl_assert_equal_sz (strlen (ALL_LF_TEXT_AS_CRLF ), entry -> file_size );
260
+ cl_assert_equal_sz (strlen (ALL_LF_TEXT_AS_CRLF ), entry -> file_size );
276
261
277
262
cl_assert ((entry = git_index_get_bypath (index , "all-crlf" , 0 )) != NULL );
278
263
cl_assert_equal_sz (strlen (ALL_CRLF_TEXT_RAW ), entry -> file_size );
@@ -341,25 +326,14 @@ void test_checkout_crlf__with_ident(void)
341
326
342
327
git_checkout_head (g_repo , & opts );
343
328
344
- if (GIT_EOL_NATIVE == GIT_EOL_LF ) {
345
- cl_assert_equal_file (
346
- ALL_LF_TEXT_RAW
347
- "\n$Id: fcf6d4d9c212dc66563b1171b1cd99953c756467 $\n" ,
348
- 0 , "crlf/lf.ident" );
349
- cl_assert_equal_file (
350
- ALL_CRLF_TEXT_AS_LF
351
- "\n$Id: f2c66ad9b2b5a734d9bf00d5000cc10a62b8a857 $\n\n" ,
352
- 0 , "crlf/crlf.ident" );
353
- } else {
354
- cl_assert_equal_file (
355
- ALL_LF_TEXT_AS_CRLF
356
- "\r\n$Id: fcf6d4d9c212dc66563b1171b1cd99953c756467 $\r\n" ,
357
- 0 , "crlf/lf.ident" );
358
- cl_assert_equal_file (
359
- ALL_CRLF_TEXT_RAW
360
- "\r\n$Id: f2c66ad9b2b5a734d9bf00d5000cc10a62b8a857 $\r\n\r\n" ,
361
- 0 , "crlf/crlf.ident" );
362
- }
329
+ cl_assert_equal_file (
330
+ ALL_LF_TEXT_AS_CRLF
331
+ "\r\n$Id: fcf6d4d9c212dc66563b1171b1cd99953c756467 $\r\n" ,
332
+ 0 , "crlf/lf.ident" );
333
+ cl_assert_equal_file (
334
+ ALL_CRLF_TEXT_RAW
335
+ "\r\n$Id: f2c66ad9b2b5a734d9bf00d5000cc10a62b8a857 $\r\n\r\n" ,
336
+ 0 , "crlf/crlf.ident" );
363
337
364
338
cl_assert_equal_file (
365
339
"$Id: f7830382dac1f1583422be5530fdfbd26289431b $\n"
@@ -394,13 +368,8 @@ void test_checkout_crlf__autocrlf_true_no_attrs(void)
394
368
395
369
git_checkout_head (g_repo , & opts );
396
370
397
- if (GIT_EOL_NATIVE == GIT_EOL_CRLF ) {
398
- check_file_contents ("./crlf/all-lf" , ALL_LF_TEXT_AS_CRLF );
399
- check_file_contents ("./crlf/all-crlf" , ALL_CRLF_TEXT_AS_CRLF );
400
- } else {
401
- check_file_contents ("./crlf/all-lf" , ALL_LF_TEXT_RAW );
402
- check_file_contents ("./crlf/all-crlf" , ALL_CRLF_TEXT_RAW );
403
- }
371
+ check_file_contents ("./crlf/all-lf" , ALL_LF_TEXT_AS_CRLF );
372
+ check_file_contents ("./crlf/all-crlf" , ALL_CRLF_TEXT_AS_CRLF );
404
373
}
405
374
406
375
void test_checkout_crlf__autocrlf_input_no_attrs (void )
@@ -447,13 +416,8 @@ void test_checkout_crlf__autocrlf_true_text_auto_attr(void)
447
416
448
417
git_checkout_head (g_repo , & opts );
449
418
450
- if (GIT_EOL_NATIVE == GIT_EOL_CRLF ) {
451
- check_file_contents ("./crlf/all-lf" , ALL_LF_TEXT_AS_CRLF );
452
- check_file_contents ("./crlf/all-crlf" , ALL_CRLF_TEXT_AS_CRLF );
453
- } else {
454
- check_file_contents ("./crlf/all-lf" , ALL_LF_TEXT_RAW );
455
- check_file_contents ("./crlf/all-crlf" , ALL_CRLF_TEXT_RAW );
456
- }
419
+ check_file_contents ("./crlf/all-lf" , ALL_LF_TEXT_AS_CRLF );
420
+ check_file_contents ("./crlf/all-crlf" , ALL_CRLF_TEXT_AS_CRLF );
457
421
}
458
422
459
423
void test_checkout_crlf__autocrlf_input_text_auto_attr (void )
@@ -483,10 +447,7 @@ void test_checkout_crlf__can_write_empty_file(void)
483
447
484
448
check_file_contents ("./crlf/test1.txt" , "" );
485
449
486
- if (GIT_EOL_NATIVE == GIT_EOL_LF )
487
- check_file_contents ("./crlf/test2.txt" , "test2.txt's content\n" );
488
- else
489
- check_file_contents ("./crlf/test2.txt" , "test2.txt's content\r\n" );
450
+ check_file_contents ("./crlf/test2.txt" , "test2.txt's content\r\n" );
490
451
491
452
check_file_contents ("./crlf/test3.txt" , "" );
492
453
}
0 commit comments