Merge branch 'ab/test-must-be-empty-for-master'
[git.git] / t / t3035-merge-sparse.sh
blob0c0b433bd3dddc4211fb4b31d3e8fab31ee5e430
1 #!/bin/sh
3 test_description='merge with sparse files'
5 . ./test-lib.sh
7 # test_file $filename $content
8 test_file () {
9 echo "$2" > "$1" &&
10 git add "$1"
13 # test_commit_this $message_and_tag
14 test_commit_this () {
15 git commit -m "$1" &&
16 git tag "$1"
19 test_expect_success 'setup' '
20 : >empty &&
21 test_file checked-out init &&
22 test_file modify_delete modify_delete_init &&
23 test_commit_this init &&
24 test_file modify_delete modify_delete_theirs &&
25 test_commit_this theirs &&
26 git reset --hard init &&
27 git rm modify_delete &&
28 test_commit_this ours &&
29 git config core.sparseCheckout true &&
30 echo "/checked-out" >.git/info/sparse-checkout &&
31 git reset --hard &&
32 ! git merge theirs
35 test_expect_success 'reset --hard works after the conflict' '
36 git reset --hard
39 test_expect_success 'is reset properly' '
40 git status --porcelain -- modify_delete >out &&
41 test_cmp empty out &&
42 test_path_is_missing modify_delete
45 test_expect_success 'setup: conflict back' '
46 ! git merge theirs
49 test_expect_success 'Merge abort works after the conflict' '
50 git merge --abort
53 test_expect_success 'is aborted properly' '
54 git status --porcelain -- modify_delete >out &&
55 test_cmp empty out &&
56 test_path_is_missing modify_delete
59 test_done