summaryrefslogtreecommitdiff
path: root/contrib/scalar/t/t9099-scalar.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/scalar/t/t9099-scalar.sh')
-rwxr-xr-xcontrib/scalar/t/t9099-scalar.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/scalar/t/t9099-scalar.sh b/contrib/scalar/t/t9099-scalar.sh
index 8978156..10b1172 100755
--- a/contrib/scalar/t/t9099-scalar.sh
+++ b/contrib/scalar/t/t9099-scalar.sh
@@ -93,4 +93,31 @@ test_expect_success 'scalar supports -c/-C' '
test true = "$(git -C sub config core.preloadIndex)"
'
+test_expect_success '`scalar [...] <dir>` errors out when dir is missing' '
+ ! scalar run config cloned 2>err &&
+ grep "cloned. does not exist" err
+'
+
+SQ="'"
+test_expect_success UNZIP 'scalar diagnose' '
+ scalar clone "file://$(pwd)" cloned --single-branch &&
+ git repack &&
+ echo "$(pwd)/.git/objects/" >>cloned/src/.git/objects/info/alternates &&
+ test_commit -C cloned/src loose &&
+ scalar diagnose cloned >out 2>err &&
+ grep "Available space" out &&
+ sed -n "s/.*$SQ\\(.*\\.zip\\)$SQ.*/\\1/p" <err >zip_path &&
+ zip_path=$(cat zip_path) &&
+ test -n "$zip_path" &&
+ unzip -v "$zip_path" &&
+ folder=${zip_path%.zip} &&
+ test_path_is_missing "$folder" &&
+ unzip -p "$zip_path" diagnostics.log >out &&
+ test_file_not_empty out &&
+ unzip -p "$zip_path" packs-local.txt >out &&
+ grep "$(pwd)/.git/objects" out &&
+ unzip -p "$zip_path" objects-local.txt >out &&
+ grep "^Total: [1-9]" out
+'
+
test_done