Follow upstream changes -- rest
[git-darcs-import.git] / tests / issue1078_symlink.sh
blobbbd01ad33ca979b5f362fefeab5b8639cb708499
1 #!/usr/bin/env bash
2 set -ev
4 # darcs does not support cygwin paths (/cygdrive/c/foo), so if
5 # we want to run the test suite under Cygwin Bash, we must
6 # convert accordingly
7 portable_pwd () {
8 if uname | grep -i cygwin > /dev/null; then
9 cygpath -w `pwd`
10 else
11 pwd
16 if echo $OS | grep -i windows; then
17 echo this test does not work on windows because
18 echo windows does not have symlinks
19 exit 0
22 rm -rf temp1 temp2
23 mkdir temp1
24 ln -s temp1 temp2
25 cd temp2
26 darcs init
27 touch a b
28 IFS='' # annoying hack for cygwin and portable_pwd below
29 DIR=`portable_pwd`
30 darcs add ${DIR}/../temp1/a # should work, just to contrast with the case below
31 darcs add ${DIR}/b # this is the case we are testing for
32 cd ..
33 rm -rf temp1 temp2