]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6025-merge-symlinks.sh
Documentation: user-manual: "git commit -a" doesn't motivate .gitignore
[thirdparty/git.git] / t / t6025-merge-symlinks.sh
CommitLineData
723024d6
JS
1#!/bin/sh
2#
3# Copyright (c) 2007 Johannes Sixt
4#
5
6test_description='merging symlinks on filesystem w/o symlink support.
7
8This tests that git-merge-recursive writes merge results as plain files
9if core.symlinks is false.'
10
11. ./test-lib.sh
12
13test_expect_success \
14'setup' '
5be60078 15git config core.symlinks false &&
723024d6 16> file &&
5be60078 17git add file &&
723024d6 18git-commit -m initial &&
5be60078
JH
19git branch b-symlink &&
20git branch b-file &&
723024d6 21l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
5be60078 22echo "120000 $l symlink" | git update-index --index-info &&
723024d6
JS
23git-commit -m master &&
24git-checkout b-symlink &&
25l=$(echo -n file-different | git-hash-object -t blob -w --stdin) &&
5be60078 26echo "120000 $l symlink" | git update-index --index-info &&
723024d6
JS
27git-commit -m b-symlink &&
28git-checkout b-file &&
29echo plain-file > symlink &&
5be60078 30git add symlink &&
723024d6
JS
31git-commit -m b-file'
32
41ac414e 33test_expect_success \
723024d6 34'merge master into b-symlink, which has a different symbolic link' '
41ac414e 35git-checkout b-symlink &&
d492b31c 36test_must_fail git-merge master'
723024d6
JS
37
38test_expect_success \
39'the merge result must be a file' '
40test -f symlink'
41
41ac414e 42test_expect_success \
723024d6 43'merge master into b-file, which has a file instead of a symbolic link' '
41ac414e 44git-reset --hard && git-checkout b-file &&
d492b31c 45test_must_fail git-merge master'
723024d6
JS
46
47test_expect_success \
48'the merge result must be a file' '
49test -f symlink'
50
41ac414e 51test_expect_success \
723024d6 52'merge b-file, which has a file instead of a symbolic link, into master' '
41ac414e
JH
53git-reset --hard &&
54git-checkout master &&
d492b31c 55test_must_fail git-merge b-file'
723024d6
JS
56
57test_expect_success \
58'the merge result must be a file' '
59test -f symlink'
60
61test_done