Merge branch 'ag/reflog-count-plural' into seen

The error message given when a reflog entry is requested that is out
of bounds has been updated to use the pluralized translation function,
Q_().

* ag/reflog-count-plural:
  object-name: use Q_() for the reflog entry count
This commit is contained in:
Junio C Hamano committed 2026-11-05 20:45:43 -08:00
commit 1839eb23b0
3 files changed
+19 -3

No files matched your search

+3 -1
View File
@@ -811,7 +811,9 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
if (flags & GET_OID_QUIETLY) {
exit(128);
}
die(_("log for '%.*s' only has %d entries"),
die(Q_("log for '%.*s' only has %d entry",
"log for '%.*s' only has %d entries",
co_cnt),
len, str, co_cnt);
}
if (flags & GET_OID_GENTLY) {
+14
View File
@@ -458,6 +458,20 @@ test_expect_success 'query reflog with gap' '
test_grep -F "warning: log for ref $m has gap after $gd" stderr
'
test_expect_success 'reflog entry out of range reports how many there are' '
test_when_finished "git update-ref -d $m" &&
GIT_COMMITTER_DATE="1117150320 -0500" git update-ref $m $A &&
test_must_fail git rev-parse --verify "main@{5}" 2>actual &&
echo "fatal: log for ${SQ}main${SQ} only has 1 entry" >expect &&
test_cmp expect actual &&
GIT_COMMITTER_DATE="1117150380 -0500" git update-ref $m $B &&
test_must_fail git rev-parse --verify "main@{5}" 2>actual &&
echo "fatal: log for ${SQ}main${SQ} only has 2 entries" >expect &&
test_cmp expect actual
'
test_expect_success 'creating initial files' '
test_when_finished rm -f M &&
echo TEST >F &&
+2 -2
View File
@@ -142,10 +142,10 @@ test_expect_success 'incorrect file in :path and :N:path' '
test_expect_success 'invalid @{n} reference' '
test_must_fail git rev-parse main@{99999} >output 2>error &&
test_must_be_empty output &&
test_grep "log for [^ ]* only has [0-9][0-9]* entries" error &&
test_grep "log for [^ ]* only has [0-9][0-9]* entr" error &&
test_must_fail git rev-parse --verify main@{99999} >output 2>error &&
test_must_be_empty output &&
test_grep "log for [^ ]* only has [0-9][0-9]* entries" error
test_grep "log for [^ ]* only has [0-9][0-9]* entr" error
'
test_expect_success 'relative path not found' '