~ubuntu-branches/debian/sid/git/sid

« back to all changes in this revision

Viewing changes to t/t3310-notes-merge-manual-resolve.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2012-06-08 00:04:11 UTC
  • mfrom: (1.2.18)
  • Revision ID: package-import@ubuntu.com-20120608000411-4oljtllc9gst19ou
Tags: 1:1.7.10.4-1
new upstream point release (thx Jonathan Nieder).

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
EOF
325
325
        git notes merge --commit &&
326
326
        # No .git/NOTES_MERGE_* files left
327
 
        test_must_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
 
327
        test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
328
328
        test_cmp /dev/null output &&
329
329
        # Merge commit has pre-merge y and pre-merge z as parents
330
330
        test "$(git rev-parse refs/notes/m^1)" = "$(cat pre_merge_y)" &&
386
386
test_expect_success 'abort notes merge' '
387
387
        git notes merge --abort &&
388
388
        # No .git/NOTES_MERGE_* files left
389
 
        test_must_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
 
389
        test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
390
390
        test_cmp /dev/null output &&
391
391
        # m has not moved (still == y)
392
392
        test "$(git rev-parse refs/notes/m)" = "$(cat pre_merge_y)" &&
453
453
        # Finalize merge
454
454
        git notes merge --commit &&
455
455
        # No .git/NOTES_MERGE_* files left
456
 
        test_must_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
 
456
        test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
457
457
        test_cmp /dev/null output &&
458
458
        # Merge commit has pre-merge y and pre-merge z as parents
459
459
        test "$(git rev-parse refs/notes/m^1)" = "$(cat pre_merge_y)" &&
542
542
test_expect_success 'resolve situation by aborting the notes merge' '
543
543
        git notes merge --abort &&
544
544
        # No .git/NOTES_MERGE_* files left
545
 
        test_must_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
 
545
        test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
546
546
        test_cmp /dev/null output &&
547
547
        # m has not moved (still == w)
548
548
        test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)" &&
553
553
        verify_notes z
554
554
'
555
555
 
 
556
cat >expect_notes <<EOF
 
557
foo
 
558
bar
 
559
EOF
 
560
 
 
561
test_expect_success 'switch cwd before committing notes merge' '
 
562
        git notes add -m foo HEAD &&
 
563
        git notes --ref=other add -m bar HEAD &&
 
564
        test_must_fail git notes merge refs/notes/other &&
 
565
        (
 
566
                cd .git/NOTES_MERGE_WORKTREE &&
 
567
                echo "foo" > $(git rev-parse HEAD) &&
 
568
                echo "bar" >> $(git rev-parse HEAD) &&
 
569
                git notes merge --commit
 
570
        ) &&
 
571
        git notes show HEAD > actual_notes &&
 
572
        test_cmp expect_notes actual_notes
 
573
'
 
574
 
556
575
test_done