Ensure that rev-parse --verify --quiet is silent when asked
about deleted reflog entries.

Helped-by: Fabian Ruch <baf...@gmail.com>
Signed-off-by: David Aguilar <dav...@gmail.com>
---
Differences since last time:

This goes back to the original approach of using "git update-ref"
plumbing instead of "git branch" when testing deleted reflogs.

 t/t1503-rev-parse-verify.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh
index 813cc1b..fd9d0c3 100755
--- a/t/t1503-rev-parse-verify.sh
+++ b/t/t1503-rev-parse-verify.sh
@@ -83,6 +83,15 @@ test_expect_success 'fails silently when using -q' '
        test -z "$(cat error)"
 '
 
+test_expect_success 'fails silently when using -q with deleted reflogs' '
+       ref=$(git rev-parse HEAD) &&
+       : >.git/logs/refs/test &&
+       git update-ref -m "reflog message for refs/test" refs/test "$ref" &&
+       git reflog delete --updateref --rewrite refs/test@{0} &&
+       test_must_fail git rev-parse -q --verify refs/test@{0} >error 2>&1 &&
+       test -z "$(cat error)"
+'
+
 test_expect_success 'no stdout output on error' '
        test -z "$(git rev-parse --verify)" &&
        test -z "$(git rev-parse --verify foo)" &&
-- 
2.1.0.30.g05c535b.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to