33f902b1b0d8eb651e0e6857f8f5b86ef633ef4a
   1#!/bin/sh
   2
   3test_description='cherry-pick should rerere for conflicts'
   4
   5. ./test-lib.sh
   6
   7test_expect_success setup '
   8        test_commit foo &&
   9        test_commit foo-master foo &&
  10
  11        git checkout -b dev foo &&
  12        test_commit foo-dev foo &&
  13        git config rerere.enabled true
  14'
  15
  16test_expect_success 'conflicting merge' '
  17        test_must_fail git merge master
  18'
  19
  20test_expect_success 'fixup' '
  21        echo foo-resolved >foo &&
  22        git commit -am resolved &&
  23        cp foo expect &&
  24        git reset --hard HEAD^
  25'
  26
  27test_expect_success 'cherry-pick conflict' '
  28        test_must_fail git cherry-pick master &&
  29        test_cmp expect foo
  30'
  31
  32test_expect_success 'reconfigure' '
  33        git config rerere.enabled false &&
  34        git reset --hard
  35'
  36
  37test_expect_success 'cherry-pick conflict without rerere' '
  38        test_must_fail git cherry-pick master &&
  39        test_must_fail test_cmp expect foo
  40'
  41
  42test_done