]>
Commit | Line | Data |
---|---|---|
a2290fb1 SW |
1 | set -e |
2 | ||
1b48018c SW |
3 | export GIT_AUTHOR_NAME=automation |
4 | export GIT_COMMITTER_NAME=automation | |
5 | export GIT_AUTHOR_EMAIL=auto@mati.on | |
6 | export GIT_COMMITTER_EMAIL=auto@mati.on | |
7 | ||
78c89e6e SW |
8 | cache_dir=$(mktemp -d) |
9 | export XDG_CACHE_HOME=$cache_dir | |
10 | ||
a2290fb1 SW |
11 | foo_setup() { |
12 | ||
13 | repo_dir="`mktemp -d`" | |
14 | repo="$repo_dir/repo" | |
15 | git init "$repo" | |
16 | ( | |
17 | cd "$repo" | |
18 | echo Contents > test-file | |
19 | git add test-file | |
20 | git commit -m 'Commit message' | |
21 | ) | |
22 | ||
23 | conf="`mktemp`" | |
24 | cat > "$conf" <<EOF | |
25 | [foo] | |
26 | git_repo = file://$repo | |
27 | git_ref = master | |
28 | EOF | |
29 | ||
30 | } | |
31 | ||
d9a1088a SW |
32 | test_cleanup() { |
33 | if [ "$repo_dir" ];then rm -rf "$repo_dir"; fi | |
34 | if [ "$conf" ];then rm "$conf"; fi | |
78c89e6e | 35 | if [ "$cache_dir" ];then rm -rf "$cache_dir"; fi |
a2290fb1 | 36 | } |
d9a1088a SW |
37 | |
38 | trap test_cleanup EXIT INT TERM |