]> asedeno.scripts.mit.edu Git - git.git/blob - t/t1004-read-tree-m-u-wf.sh
merge: loosen overcautious "working file will be lost" check.
[git.git] / t / t1004-read-tree-m-u-wf.sh
1 #!/bin/sh
2
3 test_description='read-tree -m -u checks working tree files'
4
5 . ./test-lib.sh
6
7 # two-tree test
8
9 test_expect_success 'two-way setup' '
10
11         echo >file1 file one &&
12         echo >file2 file two &&
13         git update-index --add file1 file2 &&
14         git commit -m initial &&
15
16         git branch side &&
17         git tag -f branch-point &&
18
19         echo file2 is not tracked on the master anymore &&
20         rm -f file2 &&
21         git update-index --remove file2 &&
22         git commit -a -m "master removes file2"
23 '
24
25 test_expect_success 'two-way not clobbering' '
26
27         echo >file2 master creates untracked file2 &&
28         if err=`git read-tree -m -u master side 2>&1`
29         then
30                 echo should have complained
31                 false
32         else
33                 echo "happy to see $err"
34         fi
35 '
36
37 # three-tree test
38
39 test_expect_success 'three-way not complaining' '
40
41         rm -f file2 &&
42         git checkout side &&
43         echo >file3 file three &&
44         git update-index --add file3 &&
45         git commit -a -m "side adds file3" &&
46
47         git checkout master &&
48         echo >file2 file two is untracked on the master side &&
49
50         git-read-tree -m -u branch-point master side
51 '
52
53 test_done