@@ -345,7 +345,7 @@ void test_index_conflicts__partial(void)
345
345
346
346
void test_index_conflicts__case_matters (void )
347
347
{
348
- git_index_entry * conflict_entry [3 ];
348
+ const git_index_entry * conflict_entry [3 ];
349
349
git_oid oid ;
350
350
char * upper_case = "DIFFERS-IN-CASE.TXT" ;
351
351
char * mixed_case = "Differs-In-Case.txt" ;
@@ -357,31 +357,37 @@ void test_index_conflicts__case_matters(void)
357
357
memset (& their_entry , 0x0 , sizeof (git_index_entry ));
358
358
359
359
ancestor_entry .path = upper_case ;
360
- ancestor_entry . flags |= ( 1 << GIT_IDXENTRY_STAGESHIFT );
360
+ GIT_IDXENTRY_STAGE_SET ( & ancestor_entry , GIT_INDEX_STAGE_ANCESTOR );
361
361
git_oid_fromstr (& ancestor_entry .id , CONFLICTS_ONE_ANCESTOR_OID );
362
+ ancestor_entry .mode = GIT_FILEMODE_BLOB ;
362
363
363
364
our_entry .path = upper_case ;
364
- ancestor_entry . flags |= ( 2 << GIT_IDXENTRY_STAGESHIFT );
365
+ GIT_IDXENTRY_STAGE_SET ( & our_entry , GIT_INDEX_STAGE_OURS );
365
366
git_oid_fromstr (& our_entry .id , CONFLICTS_ONE_OUR_OID );
367
+ our_entry .mode = GIT_FILEMODE_BLOB ;
366
368
367
369
their_entry .path = upper_case ;
368
- ancestor_entry . flags |= ( 3 << GIT_IDXENTRY_STAGESHIFT );
370
+ GIT_IDXENTRY_STAGE_SET ( & their_entry , GIT_INDEX_STAGE_THEIRS );
369
371
git_oid_fromstr (& their_entry .id , CONFLICTS_ONE_THEIR_OID );
372
+ their_entry .mode = GIT_FILEMODE_BLOB ;
370
373
371
374
cl_git_pass (git_index_conflict_add (repo_index ,
372
375
& ancestor_entry , & our_entry , & their_entry ));
373
376
374
377
ancestor_entry .path = mixed_case ;
375
- ancestor_entry . flags |= ( 1 << GIT_IDXENTRY_STAGESHIFT );
378
+ GIT_IDXENTRY_STAGE_SET ( & ancestor_entry , GIT_INDEX_STAGE_ANCESTOR );
376
379
git_oid_fromstr (& ancestor_entry .id , CONFLICTS_TWO_ANCESTOR_OID );
380
+ ancestor_entry .mode = GIT_FILEMODE_BLOB ;
377
381
378
382
our_entry .path = mixed_case ;
379
- ancestor_entry . flags |= ( 2 << GIT_IDXENTRY_STAGESHIFT );
383
+ GIT_IDXENTRY_STAGE_SET ( & ancestor_entry , GIT_INDEX_STAGE_ANCESTOR );
380
384
git_oid_fromstr (& our_entry .id , CONFLICTS_TWO_OUR_OID );
385
+ ancestor_entry .mode = GIT_FILEMODE_BLOB ;
381
386
382
387
their_entry .path = mixed_case ;
383
- ancestor_entry . flags |= ( 3 << GIT_IDXENTRY_STAGESHIFT );
388
+ GIT_IDXENTRY_STAGE_SET ( & their_entry , GIT_INDEX_STAGE_THEIRS );
384
389
git_oid_fromstr (& their_entry .id , CONFLICTS_TWO_THEIR_OID );
390
+ their_entry .mode = GIT_FILEMODE_BLOB ;
385
391
386
392
cl_git_pass (git_index_conflict_add (repo_index ,
387
393
& ancestor_entry , & our_entry , & their_entry ));
@@ -390,29 +396,29 @@ void test_index_conflicts__case_matters(void)
390
396
& conflict_entry [2 ], repo_index , upper_case ));
391
397
392
398
cl_assert_equal_s (upper_case , conflict_entry [0 ]-> path );
393
- git_oid_fromstr (& oid , CONFLICTS_ONE_ANCESTOR_OID );
399
+ git_oid_fromstr (& oid , CONFLICTS_ONE_ANCESTOR_OID );
394
400
cl_assert_equal_oid (& oid , & conflict_entry [0 ]-> id );
395
401
396
402
cl_assert_equal_s (upper_case , conflict_entry [1 ]-> path );
397
403
git_oid_fromstr (& oid , CONFLICTS_ONE_OUR_OID );
398
404
cl_assert_equal_oid (& oid , & conflict_entry [1 ]-> id );
399
405
400
- cl_assert_equal_s (upper_case , conflict_entry [0 ]-> path );
406
+ cl_assert_equal_s (upper_case , conflict_entry [2 ]-> path );
401
407
git_oid_fromstr (& oid , CONFLICTS_ONE_THEIR_OID );
402
408
cl_assert_equal_oid (& oid , & conflict_entry [2 ]-> id );
403
409
404
410
cl_git_pass (git_index_conflict_get (& conflict_entry [0 ], & conflict_entry [1 ],
405
411
& conflict_entry [2 ], repo_index , mixed_case ));
406
412
407
413
cl_assert_equal_s (mixed_case , conflict_entry [0 ]-> path );
408
- git_oid_fromstr (& oid , CONFLICTS_ONE_ANCESTOR_OID );
414
+ git_oid_fromstr (& oid , CONFLICTS_TWO_ANCESTOR_OID );
409
415
cl_assert_equal_oid (& oid , & conflict_entry [0 ]-> id );
410
416
411
417
cl_assert_equal_s (mixed_case , conflict_entry [1 ]-> path );
412
418
git_oid_fromstr (& oid , CONFLICTS_TWO_OUR_OID );
413
419
cl_assert_equal_oid (& oid , & conflict_entry [1 ]-> id );
414
420
415
- cl_assert_equal_s (mixed_case , conflict_entry [0 ]-> path );
421
+ cl_assert_equal_s (mixed_case , conflict_entry [2 ]-> path );
416
422
git_oid_fromstr (& oid , CONFLICTS_TWO_THEIR_OID );
417
423
cl_assert_equal_oid (& oid , & conflict_entry [2 ]-> id );
418
424
}
0 commit comments