t / t7405-submodule-merge.shon commit Merge branch 'ps/gitweb--browse-chrome' (2ad6b14)
   1#!/bin/sh
   2
   3test_description='merging with submodules'
   4
   5. ./test-lib.sh
   6
   7#
   8# history
   9#
  10#        a --- c
  11#      /   \ /
  12# root      X
  13#      \   / \
  14#        b --- d
  15#
  16
  17test_expect_success setup '
  18
  19        mkdir sub &&
  20        (cd sub &&
  21         git init &&
  22         echo original > file &&
  23         git add file &&
  24         test_tick &&
  25         git commit -m sub-root) &&
  26        git add sub &&
  27        test_tick &&
  28        git commit -m root &&
  29
  30        git checkout -b a master &&
  31        (cd sub &&
  32         echo A > file &&
  33         git add file &&
  34         test_tick &&
  35         git commit -m sub-a) &&
  36        git add sub &&
  37        test_tick &&
  38        git commit -m a &&
  39
  40        git checkout -b b master &&
  41        (cd sub &&
  42         echo B > file &&
  43         git add file &&
  44         test_tick &&
  45         git commit -m sub-b) &&
  46        git add sub &&
  47        test_tick &&
  48        git commit -m b
  49
  50        git checkout -b c a &&
  51        git merge -s ours b &&
  52
  53        git checkout -b d b &&
  54        git merge -s ours a
  55'
  56
  57test_expect_success 'merging with modify/modify conflict' '
  58
  59        git checkout -b test1 a &&
  60        test_must_fail git merge b &&
  61        test -f .git/MERGE_MSG &&
  62        git diff &&
  63        test -n "$(git ls-files -u)"
  64'
  65
  66test_expect_success 'merging with a modify/modify conflict between merge bases' '
  67
  68        git reset --hard HEAD &&
  69        git checkout -b test2 c &&
  70        git merge d
  71
  72'
  73
  74test_done