Add a demonstration/test of customized merge.
[git/gitweb.git] / t / t6026-merge-attr.sh
blob5daa2236de227c38a2d0d873cd94862fbfe2d549
1 #!/bin/sh
3 # Copyright (c) 2007 Junio C Hamano
6 test_description='per path merge controlled by merge attribute'
8 . ./test-lib.sh
10 test_expect_success setup '
12 for f in text binary union
14 echo Initial >$f && git add $f || break
15 done &&
16 test_tick &&
17 git commit -m Initial &&
19 git branch side &&
20 for f in text binary union
22 echo Master >>$f && git add $f || break
23 done &&
24 test_tick &&
25 git commit -m Master &&
27 git checkout side &&
28 for f in text binary union
30 echo Side >>$f && git add $f || break
31 done &&
32 test_tick &&
33 git commit -m Side
37 test_expect_success merge '
40 echo "binary -merge"
41 echo "union merge=union"
42 } >.gitattributes &&
44 if git merge master
45 then
46 echo Gaah, should have conflicted
47 false
48 else
49 echo Ok, conflicted.
53 test_expect_success 'check merge result in index' '
55 git ls-files -u | grep binary &&
56 git ls-files -u | grep text &&
57 ! (git ls-files -u | grep union)
61 test_expect_success 'check merge result in working tree' '
63 git cat-file -p HEAD:binary >binary-orig &&
64 grep "<<<<<<<" text &&
65 cmp binary-orig binary &&
66 ! grep "<<<<<<<" union &&
67 grep Master union &&
68 grep Side union
72 test_done