Follow upstream changes -- Bytestring updates
[git-darcs-import.git] / tests / put.sh
blobcccd70d83edc719d953fa88317d2ab79f1c0a01e
1 #!/usr/bin/env bash
2 set -ev
4 not () { "$@" && exit 1 || :; }
6 portable_pwd () {
7 if uname | grep -i cygwin > /dev/null; then
8 cygpath -w `pwd`
9 else
10 pwd
14 rm -rf temp1 temp2
15 mkdir temp1
16 cd temp1
17 darcs init
18 cd ..
20 # put should set default repo
21 cd temp1
22 touch 1.txt
23 darcs add 1.txt
24 darcs record -a -m foo 1.txt
25 darcs put ../temp2
26 test -e _darcs/prefs/defaultrepo
27 grep temp2 _darcs/prefs/defaultrepo
28 cd ..
30 # put to self
31 cd temp1
32 not grep temp1 _darcs/prefs/defaultrepo
33 # hack for cygwin and portable_pwd below
34 IFS=''
35 DIR=`portable_pwd`
36 # return special message when you try to put put yourself
37 not darcs put ${DIR} 2> log
38 not grep temp1 _darcs/prefs/defaultrepo
39 grep -i "Can't put.*current repository" log
40 cd ..
42 rm -rf temp1 temp2