3 6ae16afd 2022-10-31 stsp # Copyright (c) 2022 Stefan Sperling <stsp@openbsd.org>
5 6ae16afd 2022-10-31 stsp # Permission to use, copy, modify, and distribute this software for any
6 6ae16afd 2022-10-31 stsp # purpose with or without fee is hereby granted, provided that the above
7 6ae16afd 2022-10-31 stsp # copyright notice and this permission notice appear in all copies.
9 6ae16afd 2022-10-31 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 6ae16afd 2022-10-31 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 6ae16afd 2022-10-31 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 6ae16afd 2022-10-31 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 6ae16afd 2022-10-31 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 6ae16afd 2022-10-31 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 6ae16afd 2022-10-31 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 6ae16afd 2022-10-31 stsp . ../cmdline/common.sh
21 4ce98cf7 2022-11-08 stsp local repo_path="$1"
22 4ce98cf7 2022-11-08 stsp local no_tree="$2"
24 4ce98cf7 2022-11-08 stsp gotadmin init "${repo_path}"
26 4ce98cf7 2022-11-08 stsp if [ -n "$no_tree" ]; then
30 ea2819be 2023-05-29 op test_tree=`mktemp -d "${GOTD_TEST_ROOT}/gotd-test-tree-XXXXXXXXXX"`
31 4ce98cf7 2022-11-08 stsp make_test_tree "$test_tree"
32 4ce98cf7 2022-11-08 stsp got import -m "import the test tree" -r "${GOTD_TEST_REPO}" "$test_tree" \
34 4ce98cf7 2022-11-08 stsp rm -r "$test_tree" # TODO: trap
38 6ae16afd 2022-10-31 stsp if [ -e "${GOTD_TEST_REPO}" ]; then
39 6ae16afd 2022-10-31 stsp rm -rf "${GOTD_TEST_REPO}"
42 4ce98cf7 2022-11-08 stsp make_repo "${GOTD_TEST_REPO}" "$1"