usability: don't ask questions if no reply is required
[gitweb.git] / t / t7004-tag.sh
index b676b90c7dfd8bf743e788f07aedc2a4a8053540..b8ad076c25680cad1f9faa1de544980c78547f6c 100755 (executable)
@@ -71,6 +71,7 @@ test_expect_success 'creating a tag for an unknown revision should fail' '
 
 # commit used in the tests, test_tick is also called here to freeze the date:
 test_expect_success 'creating a tag using default HEAD should succeed' '
+       test_config core.logAllRefUpdates true &&
        test_tick &&
        echo foo >foo &&
        git add foo &&
@@ -90,6 +91,13 @@ test_expect_success '--create-reflog does not create reflog on failure' '
        test_must_fail git reflog exists refs/tags/mytag
 '
 
+test_expect_success 'option core.logAllRefUpdates=always creates reflog' '
+       test_when_finished "git tag -d tag_with_reflog" &&
+       test_config core.logAllRefUpdates always &&
+       git tag tag_with_reflog &&
+       git reflog exists refs/tags/tag_with_reflog
+'
+
 test_expect_success 'listing all tags if one exists should succeed' '
        git tag -l &&
        git tag
@@ -871,18 +879,16 @@ test_expect_success GPG 'verifying a forged tag should fail' '
        test_must_fail git tag -v forged-tag
 '
 
-test_expect_success 'verifying a proper tag with --format pass and format accordingly' '
-       cat >expect <<-\EOF
+test_expect_success GPG 'verifying a proper tag with --format pass and format accordingly' '
+       cat >expect <<-\EOF &&
        tagname : signed-tag
-       EOF &&
+       EOF
        git tag -v --format="tagname : %(tag)" "signed-tag" >actual &&
        test_cmp expect actual
 '
 
-test_expect_success 'verifying a forged tag with --format fail and format accordingly' '
-       cat >expect <<-\EOF
-       tagname : forged-tag
-       EOF &&
+test_expect_success GPG 'verifying a forged tag with --format should fail silently' '
+       >expect &&
        test_must_fail git tag -v --format="tagname : %(tag)" "forged-tag" >actual &&
        test_cmp expect actual
 '