d79542d847627f0e8bb228b69baac8e75b70a5f2
   1#!/bin/sh
   2
   3test_description='git merge
   4
   5Testing merge when using a custom message for the merge commit.'
   6
   7. ./test-lib.sh
   8
   9create_merge_msgs() {
  10        echo >exp.subject "custom message"
  11}
  12
  13test_expect_success 'setup' '
  14        echo c0 > c0.c &&
  15        git add c0.c &&
  16        git commit -m c0 &&
  17        git tag c0 &&
  18        echo c1 > c1.c &&
  19        git add c1.c &&
  20        git commit -m c1 &&
  21        git tag c1 &&
  22        git reset --hard c0 &&
  23        echo c2 > c2.c &&
  24        git add c2.c &&
  25        git commit -m c2 &&
  26        git tag c2 &&
  27        create_merge_msgs
  28'
  29
  30
  31test_expect_success 'merge c2 with a custom message' '
  32        git reset --hard c1 &&
  33        git merge -m "$(cat exp.subject)" c2 &&
  34        git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
  35        test_cmp exp.subject actual
  36'
  37
  38test_done