]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7900-maintenance.sh
maintenance: add option to register in a specific config
[thirdparty/git.git] / t / t7900-maintenance.sh
index 96bdd4204560c58ec2fe97f9898e698a2379549f..823331e44a03b2f62e9f1577a84f08863150388d 100755 (executable)
@@ -500,9 +500,28 @@ test_expect_success 'register and unregister' '
        git config --global --get-all maintenance.repo >actual &&
        test_cmp before actual &&
 
+       git config --file ./other --add maintenance.repo /existing1 &&
+       git config --file ./other --add maintenance.repo /existing2 &&
+       git config --file ./other --get-all maintenance.repo >before &&
+
+       git maintenance register --config-file ./other &&
+       test_cmp_config false maintenance.auto &&
+       git config --file ./other --get-all maintenance.repo >between &&
+       cp before expect &&
+       pwd >>expect &&
+       test_cmp expect between &&
+
+       git maintenance unregister --config-file ./other &&
+       git config --file ./other --get-all maintenance.repo >actual &&
+       test_cmp before actual &&
+
        test_must_fail git maintenance unregister 2>err &&
        grep "is not registered" err &&
-       git maintenance unregister --force
+       git maintenance unregister --force &&
+
+       test_must_fail git maintenance unregister --config-file ./other 2>err &&
+       grep "is not registered" err &&
+       git maintenance unregister --config-file ./other --force
 '
 
 test_expect_success !MINGW 'register and unregister with regex metacharacters' '