pack-objects: simplify --filter handling
[git/debian.git] / t / t6435-merge-sparse.sh
blobfde4aa3cd1ab66a13c61234155da0c2bacb851a9
1 #!/bin/sh
3 test_description='merge with sparse files'
5 TEST_CREATE_REPO_NO_TEMPLATE=1
6 . ./test-lib.sh
8 # test_file $filename $content
9 test_file () {
10 echo "$2" > "$1" &&
11 git add "$1"
14 # test_commit_this $message_and_tag
15 test_commit_this () {
16 git commit -m "$1" &&
17 git tag "$1"
20 test_expect_success 'setup' '
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 mkdir .git/info &&
31 echo "/checked-out" >.git/info/sparse-checkout &&
32 git reset --hard &&
33 test_must_fail git merge theirs
36 test_expect_success 'reset --hard works after the conflict' '
37 git reset --hard
40 test_expect_success 'is reset properly' '
41 git status --porcelain -- modify_delete >out &&
42 test_must_be_empty out &&
43 test_path_is_missing modify_delete
46 test_expect_success 'setup: conflict back' '
47 test_must_fail git merge theirs
50 test_expect_success 'Merge abort works after the conflict' '
51 git merge --abort
54 test_expect_success 'is aborted properly' '
55 git status --porcelain -- modify_delete >out &&
56 test_must_be_empty out &&
57 test_path_is_missing modify_delete
60 test_done