]> git.scottworley.com Git - pinch/blobdiff - tests/reject-nonancestor.sh
Use separate cache dir for test isolation
[pinch] / tests / reject-nonancestor.sh
index b8e944ac52ced7713d562a08d2890f55e584e47d..f8cc2e98694b7cc1afbd5ce0042d7ab8a5ab0676 100755 (executable)
@@ -1,23 +1,8 @@
 #!/bin/sh
 
-set -e
+. ./tests/lib/test-setup.sh
 
-repo_dir="`mktemp -d`"
-repo="$repo_dir/repo"
-git init "$repo"
-(
-  cd "$repo"
-  echo Contents > test-file
-  git add test-file
-  git commit -m 'Commit message'
-)
-
-conf="`mktemp`"
-cat > "$conf" <<EOF
-[foo]
-git_repo = file://$repo
-git_ref = master
-EOF
+foo_setup
 
 python3 ./pinch.py pin "$conf"
 
@@ -34,5 +19,3 @@ if python3 ./pinch.py pin "$conf";then
 else
   echo PASS
 fi
-
-rm -rf "$repo_dir" "$conf"