summaryrefslogtreecommitdiff
path: root/exporters/darcs/t/testimport-gitsymlink.sh
blob: 100c5833da09bf4c58a209e14ee024a2a9eae4f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
. ./lib.sh

create_git test
cd test
# add two dirs with the some contents, then remove the second
# and make it a symlink to the first
mkdir dira
echo blabla > dira/file
echo blablabla > dira/file2
mkdir dirb
touch dirb/file
touch dirb/file2
git add dira dirb
git commit -a -m "add dira/dirb"
rm -rf dirb
ln -s dira dirb
git add dirb
git commit -a -m "change a dir to a symlink"
cd ..

rm -rf test.darcs
mkdir test.darcs
cd test.darcs
darcs init
cd ..
(cd test; git fast-export --progress=2 HEAD) | (cd test.darcs; darcs-fast-import)
# we *do* want this to fail, but with error code 2. that means that we
# detected that symlinks are not supported and the user does not get a
# meaningless exception
if [ $? != 2 ]; then
	exit 1
fi

# now try with the symhack option
rm -rf test.darcs
mkdir test.darcs
cd test.darcs
darcs init
cd ..
(cd test; git fast-export --progress=2 HEAD) | (cd test.darcs; darcs-fast-import --symhack)
if [ $? != 0 ]; then
	exit 1
fi
diff_importgit test
exit $?