]>
Commit | Line | Data |
---|---|---|
b33fdfc3 MK |
1 | #!/bin/sh |
2 | ||
3 | test_description='merge with sparse files' | |
4 | ||
ead74601 | 5 | TEST_CREATE_REPO_NO_TEMPLATE=1 |
b33fdfc3 MK |
6 | . ./test-lib.sh |
7 | ||
8 | # test_file $filename $content | |
9 | test_file () { | |
10 | echo "$2" > "$1" && | |
11 | git add "$1" | |
12 | } | |
13 | ||
14 | # test_commit_this $message_and_tag | |
15 | test_commit_this () { | |
16 | git commit -m "$1" && | |
17 | git tag "$1" | |
18 | } | |
19 | ||
20 | test_expect_success 'setup' ' | |
b33fdfc3 MK |
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 && | |
ead74601 | 30 | mkdir .git/info && |
b33fdfc3 MK |
31 | echo "/checked-out" >.git/info/sparse-checkout && |
32 | git reset --hard && | |
d5bb92ec | 33 | test_must_fail git merge theirs |
b33fdfc3 MK |
34 | ' |
35 | ||
36 | test_expect_success 'reset --hard works after the conflict' ' | |
37 | git reset --hard | |
38 | ' | |
39 | ||
40 | test_expect_success 'is reset properly' ' | |
41 | git status --porcelain -- modify_delete >out && | |
1c5e94f4 | 42 | test_must_be_empty out && |
b33fdfc3 MK |
43 | test_path_is_missing modify_delete |
44 | ' | |
45 | ||
46 | test_expect_success 'setup: conflict back' ' | |
d5bb92ec | 47 | test_must_fail git merge theirs |
b33fdfc3 MK |
48 | ' |
49 | ||
50 | test_expect_success 'Merge abort works after the conflict' ' | |
51 | git merge --abort | |
52 | ' | |
53 | ||
54 | test_expect_success 'is aborted properly' ' | |
55 | git status --porcelain -- modify_delete >out && | |
1c5e94f4 | 56 | test_must_be_empty out && |
b33fdfc3 MK |
57 | test_path_is_missing modify_delete |
58 | ' | |
59 | ||
60 | test_done |