]> git.scottworley.com Git - pinch/blame - tests/reject-duplicates.sh
Add missing type annotation
[pinch] / tests / reject-duplicates.sh
CommitLineData
ab7ebb2f
SW
1#!/bin/sh
2
3repo_dir1="`mktemp -d`"
4repo1="$repo_dir1/repo"
5git init "$repo1"
6(
7 cd "$repo1"
8 echo Contents > test-file
9 git add test-file
10 git commit -m 'Commit message'
11)
12
13repo_dir2="`mktemp -d`"
14repo2="$repo_dir2/repo"
15git init "$repo2"
16(
17 cd "$repo2"
18 echo Contents > test-file
19 git add test-file
20 git commit -m 'Commit message'
21)
22
23conf1="`mktemp`"
24cat > "$conf1" <<EOF
25[same]
26git_repo = file://$repo1
27git_ref = master
28EOF
29
30conf2="`mktemp`"
31cat > "$conf2" <<EOF
32[same]
33git_repo = file://$repo2
34git_ref = master
35EOF
36
37python3 ./pinch.py pin "$conf1"
38python3 ./pinch.py pin "$conf2"
39
40if python3 ./pinch.py update --dry-run "$conf1" "$conf2";then
41 echo "FAIL: Duplicate names should be rejected"
42 exit 1
43else
44 echo PASS
45fi
46
47rm -rf "$repo_dir1" "$repo_dir2" "$conf1" "$conf2"
48