Find git executable at run time
[git-darcs-import.git] / tests / bad-match-pattern.sh
blobcabe7292ed285ffb6c7d32d4769558c1455a003b
1 #!/usr/bin/env bash
3 # This is a test for issue761, which pointed out that we didn't check the
4 # syntax of --match patterns until after having spent considerable time
5 # doing considerable work. So here we construct a very invalid repository,
6 # and check that darcs fails *before* it notices that it's pulling from a
7 # bad repository. Thus we verify that we aren't doing any work prior to
8 # checking the flags.
10 set -ev
12 rm -rf temp1 temp2
13 mkdir temp1
14 cd temp1
15 darcs init
16 touch foo bar
17 darcs add foo bar
18 darcs record -a -m 'add two files'
19 darcs tag -m tag
20 rm foo bar
21 darcs record -a -m 'rm two files'
22 darcs tag -m tag2
24 rm -rf _darcs/inventories/*
25 rm -rf _darcs/patches/*
27 cd ..
29 mkdir temp2
30 cd temp2
31 darcs init
32 ! darcs pull --match 'foobar' ../temp1 2> error
33 cat error
35 grep foobar error
37 rm -rf temp1 temp2