#!/usr/bin/env bash

# http://bugs.darcs.net/issue1057: Identifying current repository when pulling from repository identified via symbolic link


. lib

rm -rf temp
mkdir temp
cd temp

mkdir repo
cd repo
darcs init
cd ..

ln -s repo srepo
cd srepo
DIR=`hspwd`
echo $DIR
not darcs pull --debug -a "$DIR" 2> out
cat out
grep 'Can.t pull from current repository' out
cd ..

cd ..
rm -rf temp
