interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t6435-merge-sparse.sh

60 lines · 1314 bytes Raw Blame History
1#!/bin/sh
2
3test_description='merge with sparse files'
4
5TEST_CREATE_REPO_NO_TEMPLATE=1
6. ./test-lib.sh
7
8# test_file $filename $content
9test_file () {
10 echo "$2" > "$1" &&
11 git add "$1"
12}
13
14# test_commit_this $message_and_tag
15test_commit_this () {
16 git commit -m "$1" &&
17 git tag "$1"
18}
19
20test_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
34'
35
36test_expect_success 'reset --hard works after the conflict' '
37 git reset --hard
38'
39
40test_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
44'
45
46test_expect_success 'setup: conflict back' '
47 test_must_fail git merge theirs
48'
49
50test_expect_success 'Merge abort works after the conflict' '
51 git merge --abort
52'
53
54test_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
58'
59
60test_done