2007-03-03 20:32:46 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2007 Johannes Sixt
|
|
|
|
#
|
|
|
|
|
|
|
|
test_description='merging symlinks on filesystem w/o symlink support.
|
|
|
|
|
2008-09-03 10:59:29 +02:00
|
|
|
This tests that git merge-recursive writes merge results as plain files
|
2007-03-03 20:32:46 +01:00
|
|
|
if core.symlinks is false.'
|
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'setup' '
|
2007-07-03 07:52:14 +02:00
|
|
|
git config core.symlinks false &&
|
2007-03-03 20:32:46 +01:00
|
|
|
> file &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git add file &&
|
2008-09-03 10:59:29 +02:00
|
|
|
git commit -m initial &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git branch b-symlink &&
|
|
|
|
git branch b-file &&
|
2008-10-31 06:09:13 +01:00
|
|
|
l=$(printf file | git hash-object -t blob -w --stdin) &&
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "120000 $l symlink" | git update-index --index-info &&
|
2008-09-03 10:59:29 +02:00
|
|
|
git commit -m master &&
|
|
|
|
git checkout b-symlink &&
|
2008-10-31 06:09:13 +01:00
|
|
|
l=$(printf file-different | git hash-object -t blob -w --stdin) &&
|
2007-07-03 07:52:14 +02:00
|
|
|
echo "120000 $l symlink" | git update-index --index-info &&
|
2008-09-03 10:59:29 +02:00
|
|
|
git commit -m b-symlink &&
|
|
|
|
git checkout b-file &&
|
2007-03-03 20:32:46 +01:00
|
|
|
echo plain-file > symlink &&
|
2007-07-03 07:52:14 +02:00
|
|
|
git add symlink &&
|
2008-09-03 10:59:29 +02:00
|
|
|
git commit -m b-file'
|
2007-03-03 20:32:46 +01:00
|
|
|
|
2008-02-01 10:50:53 +01:00
|
|
|
test_expect_success \
|
2007-03-03 20:32:46 +01:00
|
|
|
'merge master into b-symlink, which has a different symbolic link' '
|
2008-09-03 10:59:29 +02:00
|
|
|
git checkout b-symlink &&
|
|
|
|
test_must_fail git merge master'
|
2007-03-03 20:32:46 +01:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'the merge result must be a file' '
|
|
|
|
test -f symlink'
|
|
|
|
|
2008-02-01 10:50:53 +01:00
|
|
|
test_expect_success \
|
2007-03-03 20:32:46 +01:00
|
|
|
'merge master into b-file, which has a file instead of a symbolic link' '
|
2008-09-03 10:59:29 +02:00
|
|
|
git reset --hard && git checkout b-file &&
|
|
|
|
test_must_fail git merge master'
|
2007-03-03 20:32:46 +01:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'the merge result must be a file' '
|
|
|
|
test -f symlink'
|
|
|
|
|
2008-02-01 10:50:53 +01:00
|
|
|
test_expect_success \
|
2007-03-03 20:32:46 +01:00
|
|
|
'merge b-file, which has a file instead of a symbolic link, into master' '
|
2008-09-03 10:59:29 +02:00
|
|
|
git reset --hard &&
|
|
|
|
git checkout master &&
|
|
|
|
test_must_fail git merge b-file'
|
2007-03-03 20:32:46 +01:00
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'the merge result must be a file' '
|
|
|
|
test -f symlink'
|
|
|
|
|
|
|
|
test_done
|