summaryrefslogtreecommitdiff
path: root/t/t7900-maintenance.sh
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-10-15 17:22:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-10-16 15:36:42 (GMT)
commit61f7a383d3b9a7306f1fd44a8dfa070deacc0752 (patch)
treea3a32480d13bc5a104b0067039b45f46806d61a1 /t/t7900-maintenance.sh
parenta4cb1a2339c1aa4ba71ebc6d2b07d537e1071124 (diff)
downloadgit-61f7a383d3b9a7306f1fd44a8dfa070deacc0752.zip
git-61f7a383d3b9a7306f1fd44a8dfa070deacc0752.tar.gz
git-61f7a383d3b9a7306f1fd44a8dfa070deacc0752.tar.bz2
maintenance: use 'incremental' strategy by default
The 'git maintenance (register|start)' subcommands add the current repository to the global Git config so maintenance will operate on that repository. It does not specify what maintenance should occur or how often. To make it simple for users to start background maintenance with a recommended schedlue, update the 'maintenance.strategy' config option in both the 'register' and 'start' subcommands. This allows users to customize beyond the defaults using individual 'maintenance.<task>.schedule' options, but also the user can opt-out of this strategy using 'maintenance.strategy=none'. Helped-by: Martin Ă…gren <martin.agren@gmail.com> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7900-maintenance.sh')
-rwxr-xr-xt/t7900-maintenance.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 7440a0e..20184e9 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -354,11 +354,14 @@ test_expect_success 'register and unregister' '
git config --global --add maintenance.repo /existing1 &&
git config --global --add maintenance.repo /existing2 &&
git config --global --get-all maintenance.repo >before &&
+
git maintenance register &&
- git config --global --get-all maintenance.repo >actual &&
- cp before after &&
- pwd >>after &&
- test_cmp after actual &&
+ test_cmp_config false maintenance.auto &&
+ git config --global --get-all maintenance.repo >between &&
+ cp before expect &&
+ pwd >>expect &&
+ test_cmp expect between &&
+
git maintenance unregister &&
git config --global --get-all maintenance.repo >actual &&
test_cmp before actual
@@ -392,4 +395,13 @@ test_expect_success 'start preserves existing schedule' '
grep "Important information!" cron.txt
'
+test_expect_success 'register preserves existing strategy' '
+ git config maintenance.strategy none &&
+ git maintenance register &&
+ test_config maintenance.strategy none &&
+ git config --unset maintenance.strategy &&
+ git maintenance register &&
+ test_config maintenance.strategy incremental
+'
+
test_done