aboutsummaryrefslogtreecommitdiffstats
path: root/t/t7900-maintenance.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7900-maintenance.sh')
-rwxr-xr-xt/t7900-maintenance.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
new file mode 100755
index 0000000000..c2f0b1d0c0
--- /dev/null
+++ b/t/t7900-maintenance.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+test_description='git maintenance builtin'
+
+. ./test-lib.sh
+
+test_expect_success 'help text' '
+ test_expect_code 129 git maintenance -h 2>err &&
+ test_i18ngrep "usage: git maintenance run" err &&
+ test_expect_code 128 git maintenance barf 2>err &&
+ test_i18ngrep "invalid subcommand: barf" err &&
+ test_expect_code 129 git maintenance 2>err &&
+ test_i18ngrep "usage: git maintenance" err
+'
+
+test_expect_success 'run [--auto]' '
+ GIT_TRACE2_EVENT="$(pwd)/run-no-auto.txt" git maintenance run &&
+ GIT_TRACE2_EVENT="$(pwd)/run-auto.txt" git maintenance run --auto &&
+ test_subcommand git gc <run-no-auto.txt &&
+ test_subcommand git gc --auto <run-auto.txt
+'
+
+test_done