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 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#!/usr/bin/env bash
# Some tests for 'darcs rec --edit-long-comment'
. lib
abort_windows
rm -rf temp1
export DARCS_EDITOR="/bin/cat -n"
# editor: space in command
mkdir temp1
cd temp1
darcs init
touch file.t
darcs add file.t
echo y | darcs record --edit-long-comment -a -m foo file.t | grep '2.*END OF DESCRIPTION'
cd ..
rm -rf temp1
# editor: space in path
mkdir temp2\ dir
cd temp2\ dir
darcs init
touch file.t
darcs add file.t
echo y | darcs record --edit-long-comment -a -m foo file.t | grep '2.*END OF DESCRIPTION'
cd ..
rm -rf temp2\ dir
export DARCS_EDITOR='grep "END OF"'
# editor: quoting in command
mkdir temp1
cd temp1
darcs init
touch file.t
darcs add file.t
echo y | darcs record --edit-long-comment -a -m foo file.t | grep 'END OF'
cd ..
rm -rf temp1
export DARCS_EDITOR='/bin/echo'
# editor: evil filename
mkdir temp1
cd temp1
darcs init
touch file.t
darcs add file.t
touch '; test-command'
echo > test-command << FOO
#!/bin/sh
echo EVIL
FOO
chmod u+x test-command
echo y | darcs record --logfile='; test-command' --edit-long-comment -a -m foo file.t > log
not grep EVIL log
cd ..
rm -rf temp1
|