]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7900-maintenance.sh
config API: add "string" version of *_value_multi(), fix segfaults
[thirdparty/git.git] / t / t7900-maintenance.sh
index d82eac6a471eacef7d8038ce1c7b014f87d95bb5..487e326b3fac126fb611e50851465d7d8b963888 100755 (executable)
@@ -524,7 +524,7 @@ test_expect_success 'register and unregister' '
        git maintenance unregister --config-file ./other --force
 '
 
-test_expect_failure 'register with no value for maintenance.repo' '
+test_expect_success 'register with no value for maintenance.repo' '
        cp .git/config .git/config.orig &&
        test_when_finished mv .git/config.orig .git/config &&
 
@@ -532,10 +532,15 @@ test_expect_failure 'register with no value for maintenance.repo' '
        [maintenance]
                repo
        EOF
-       git maintenance register
+       cat >expect <<-\EOF &&
+       error: missing value for '\''maintenance.repo'\''
+       EOF
+       git maintenance register 2>actual &&
+       test_cmp expect actual &&
+       git config maintenance.repo
 '
 
-test_expect_failure 'unregister with no value for maintenance.repo' '
+test_expect_success 'unregister with no value for maintenance.repo' '
        cp .git/config .git/config.orig &&
        test_when_finished mv .git/config.orig .git/config &&
 
@@ -543,8 +548,18 @@ test_expect_failure 'unregister with no value for maintenance.repo' '
        [maintenance]
                repo
        EOF
-       git maintenance unregister &&
-       git maintenance unregister --force
+       cat >expect <<-\EOF &&
+       error: missing value for '\''maintenance.repo'\''
+       EOF
+       test_expect_code 128 git maintenance unregister 2>actual.raw &&
+       grep ^error actual.raw >actual &&
+       test_cmp expect actual &&
+       git config maintenance.repo &&
+
+       git maintenance unregister --force 2>actual.raw &&
+       grep ^error actual.raw >actual &&
+       test_cmp expect actual &&
+       git config maintenance.repo
 '
 
 test_expect_success !MINGW 'register and unregister with regex metacharacters' '