]>
Commit | Line | Data |
---|---|---|
a2290fb1 SW |
1 | set -e |
2 | ||
3 | foo_setup() { | |
4 | ||
5 | repo_dir="`mktemp -d`" | |
6 | repo="$repo_dir/repo" | |
7 | git init "$repo" | |
8 | ( | |
9 | cd "$repo" | |
10 | echo Contents > test-file | |
11 | git add test-file | |
12 | git commit -m 'Commit message' | |
13 | ) | |
14 | ||
15 | conf="`mktemp`" | |
16 | cat > "$conf" <<EOF | |
17 | [foo] | |
18 | git_repo = file://$repo | |
19 | git_ref = master | |
20 | EOF | |
21 | ||
22 | } | |
23 | ||
d9a1088a SW |
24 | test_cleanup() { |
25 | if [ "$repo_dir" ];then rm -rf "$repo_dir"; fi | |
26 | if [ "$conf" ];then rm "$conf"; fi | |
a2290fb1 | 27 | } |
d9a1088a SW |
28 | |
29 | trap test_cleanup EXIT INT TERM |