t / t6015-rev-list-show-all-parents.shon commit demonstrate broken 'git cherry-pick three one two' (d023c24)
   1#!/bin/sh
   2
   3test_description='--show-all --parents does not rewrite TREESAME commits'
   4
   5. ./test-lib.sh
   6
   7test_expect_success 'set up --show-all --parents test' '
   8        test_commit one foo.txt &&
   9        commit1=`git rev-list -1 HEAD` &&
  10        test_commit two bar.txt &&
  11        commit2=`git rev-list -1 HEAD` &&
  12        test_commit three foo.txt &&
  13        commit3=`git rev-list -1 HEAD`
  14        '
  15
  16test_expect_success '--parents rewrites TREESAME parents correctly' '
  17        echo $commit3 $commit1 > expected &&
  18        echo $commit1 >> expected &&
  19        git rev-list --parents HEAD -- foo.txt > actual &&
  20        test_cmp expected actual
  21        '
  22
  23test_expect_success '--parents --show-all does not rewrites TREESAME parents' '
  24        echo $commit3 $commit2 > expected &&
  25        echo $commit2 $commit1 >> expected &&
  26        echo $commit1 >> expected &&
  27        git rev-list --parents --show-all HEAD -- foo.txt > actual &&
  28        test_cmp expected actual
  29        '
  30
  31test_done