summaryrefslogtreecommitdiff
path: root/t/t1410-reflog.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2019-03-15 15:59:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-18 06:09:40 (GMT)
commitfe66776db0b841d4d4cf64f078e1ffd82193442a (patch)
tree1a23ec5a1d05446aef824698a0e4a96a70b87f1f /t/t1410-reflog.sh
parenta65bf78c4db0dda04ce726250ed84d23f109433f (diff)
downloadgit-fe66776db0b841d4d4cf64f078e1ffd82193442a.zip
git-fe66776db0b841d4d4cf64f078e1ffd82193442a.tar.gz
git-fe66776db0b841d4d4cf64f078e1ffd82193442a.tar.bz2
reflog tests: test for the "points nowhere" warning
The "git reflog expire" command when given an unknown reference has since 4264dc15e1 ("git reflog expire", 2006-12-19) when this command was implemented emit an error, but this has never been tested for. Let's test for it, also under gc.reflogExpire{Unreachable,}=never in case a future change is tempted to take shortcuts in the presence of such config. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1410-reflog.sh')
-rwxr-xr-xt/t1410-reflog.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 42f5ac9..e8f8ac9 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -250,6 +250,16 @@ test_expect_success 'gc.reflogexpire=false' '
'
+test_expect_success 'git reflog expire unknown reference' '
+ test_config gc.reflogexpire never &&
+ test_config gc.reflogexpireunreachable never &&
+
+ test_must_fail git reflog expire master@{123} 2>stderr &&
+ test_i18ngrep "points nowhere" stderr &&
+ test_must_fail git reflog expire does-not-exist 2>stderr &&
+ test_i18ngrep "points nowhere" stderr
+'
+
test_expect_success 'checkout should not delete log for packed ref' '
test $(git reflog master | wc -l) = 4 &&
git branch foo &&