Follow upstream changes -- rest
[git-darcs-import.git] / tests / issue1057.sh
blob8734d38ff6e97c3ac8287d48e4447287064fe46f
1 #!/usr/bin/env bash
3 # http://bugs.darcs.net/issue1057: Identifying current repository when pulling from repository identified via symbolic link
5 set -ev
7 ## I would use the builtin !, but that has the wrong semantics.
8 not () { "$@" && exit 1 || :; }
10 # darcs does not support cygwin paths (/cygdrive/c/foo), so if
11 # we want to run the test suite under Cygwin Bash, we must
12 # convert accordingly
13 portable_pwd () {
14 if uname | grep -i cygwin > /dev/null; then
15 cygpath -w `pwd`
16 else
17 pwd
21 rm -rf temp
22 mkdir temp
23 cd temp
25 mkdir repo
26 cd repo
27 darcs init
28 cd ..
30 ln -s repo srepo
31 cd srepo
32 IFS='' # annoying hack for cygwin and portable_pwd below
33 DIR=`portable_pwd`
34 echo $DIR
35 not darcs pull --debug -a "$DIR" 2> out
36 cat out
37 grep 'Can.t pull from current repository' out
38 cd ..
40 cd ..
41 rm -rf temp