Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
refs.c: mark more strings for translation
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sat, 21 Jul 2018 07:49:35 +0000
(09:49 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 23 Jul 2018 18:19:10 +0000
(11:19 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
patch
|
blob
|
history
t/t1400-update-ref.sh
patch
|
blob
|
history
t/t1404-update-ref-errors.sh
patch
|
blob
|
history
t/t3210-pack-refs.sh
patch
|
blob
|
history
t/t3310-notes-merge-manual-resolve.sh
patch
|
blob
|
history
t/t5505-remote.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c60d769
)
diff --git
a/refs.c
b/refs.c
index a033910353b66323b8efe6534af5c78938cb9501..becb78e44179518cf26e38b72972a43df48eb032 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-188,7
+188,7
@@
int ref_resolves_to_object(const char *refname,
if (flags & REF_ISBROKEN)
return 0;
if (!has_sha1_file(oid->hash)) {
if (flags & REF_ISBROKEN)
return 0;
if (!has_sha1_file(oid->hash)) {
- error(
"%s does not point to a valid object!"
, refname);
+ error(
_("%s does not point to a valid object!")
, refname);
return 0;
}
return 1;
return 0;
}
return 1;
@@
-567,9
+567,9
@@
int expand_ref(const char *str, int len, struct object_id *oid, char **ref)
if (!warn_ambiguous_refs)
break;
} else if ((flag & REF_ISSYMREF) && strcmp(fullref.buf, "HEAD")) {
if (!warn_ambiguous_refs)
break;
} else if ((flag & REF_ISSYMREF) && strcmp(fullref.buf, "HEAD")) {
- warning(
"ignoring dangling symref %s"
, fullref.buf);
+ warning(
_("ignoring dangling symref %s")
, fullref.buf);
} else if ((flag & REF_ISBROKEN) && strchr(fullref.buf, '/')) {
} else if ((flag & REF_ISBROKEN) && strchr(fullref.buf, '/')) {
- warning(
"ignoring broken ref %s"
, fullref.buf);
+ warning(
_("ignoring broken ref %s")
, fullref.buf);
}
}
strbuf_release(&fullref);
}
}
strbuf_release(&fullref);
@@
-673,7
+673,7
@@
static int write_pseudoref(const char *pseudoref, const struct object_id *oid,
fd = hold_lock_file_for_update_timeout(&lock, filename, 0,
get_files_ref_lock_timeout_ms());
if (fd < 0) {
fd = hold_lock_file_for_update_timeout(&lock, filename, 0,
get_files_ref_lock_timeout_ms());
if (fd < 0) {
- strbuf_addf(err,
"could not open '%s' for writing: %s"
,
+ strbuf_addf(err,
_("could not open '%s' for writing: %s")
,
filename, strerror(errno));
goto done;
}
filename, strerror(errno));
goto done;
}
@@
-683,18
+683,18
@@
static int write_pseudoref(const char *pseudoref, const struct object_id *oid,
if (read_ref(pseudoref, &actual_old_oid)) {
if (!is_null_oid(old_oid)) {
if (read_ref(pseudoref, &actual_old_oid)) {
if (!is_null_oid(old_oid)) {
- strbuf_addf(err,
"could not read ref '%s'"
,
+ strbuf_addf(err,
_("could not read ref '%s'")
,
pseudoref);
rollback_lock_file(&lock);
goto done;
}
} else if (is_null_oid(old_oid)) {
pseudoref);
rollback_lock_file(&lock);
goto done;
}
} else if (is_null_oid(old_oid)) {
- strbuf_addf(err,
"ref '%s' already exists"
,
+ strbuf_addf(err,
_("ref '%s' already exists")
,
pseudoref);
rollback_lock_file(&lock);
goto done;
} else if (oidcmp(&actual_old_oid, old_oid)) {
pseudoref);
rollback_lock_file(&lock);
goto done;
} else if (oidcmp(&actual_old_oid, old_oid)) {
- strbuf_addf(err,
"unexpected object ID when writing '%s'"
,
+ strbuf_addf(err,
_("unexpected object ID when writing '%s'")
,
pseudoref);
rollback_lock_file(&lock);
goto done;
pseudoref);
rollback_lock_file(&lock);
goto done;
@@
-702,7
+702,7
@@
static int write_pseudoref(const char *pseudoref, const struct object_id *oid,
}
if (write_in_full(fd, buf.buf, buf.len) < 0) {
}
if (write_in_full(fd, buf.buf, buf.len) < 0) {
- strbuf_addf(err,
"could not write to '%s'"
, filename);
+ strbuf_addf(err,
_("could not write to '%s'")
, filename);
rollback_lock_file(&lock);
goto done;
}
rollback_lock_file(&lock);
goto done;
}
@@
-734,9
+734,9
@@
static int delete_pseudoref(const char *pseudoref, const struct object_id *old_o
return -1;
}
if (read_ref(pseudoref, &actual_old_oid))
return -1;
}
if (read_ref(pseudoref, &actual_old_oid))
- die(
"could not read ref '%s'"
, pseudoref);
+ die(
_("could not read ref '%s'")
, pseudoref);
if (oidcmp(&actual_old_oid, old_oid)) {
if (oidcmp(&actual_old_oid, old_oid)) {
- error(
"unexpected object ID when deleting '%s'"
,
+ error(
_("unexpected object ID when deleting '%s'")
,
pseudoref);
rollback_lock_file(&lock);
return -1;
pseudoref);
rollback_lock_file(&lock);
return -1;
@@
-871,13
+871,13
@@
static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,
if (!is_null_oid(&cb->ooid)) {
oidcpy(cb->oid, noid);
if (oidcmp(&cb->ooid, noid))
if (!is_null_oid(&cb->ooid)) {
oidcpy(cb->oid, noid);
if (oidcmp(&cb->ooid, noid))
- warning(
"log for ref %s has gap after %s"
,
+ warning(
_("log for ref %s has gap after %s")
,
cb->refname, show_date(cb->date, cb->tz, DATE_MODE(RFC2822)));
}
else if (cb->date == cb->at_time)
oidcpy(cb->oid, noid);
else if (oidcmp(noid, cb->oid))
cb->refname, show_date(cb->date, cb->tz, DATE_MODE(RFC2822)));
}
else if (cb->date == cb->at_time)
oidcpy(cb->oid, noid);
else if (oidcmp(noid, cb->oid))
- warning(
"log for ref %s unexpectedly ended on %s"
,
+ warning(
_("log for ref %s unexpectedly ended on %s")
,
cb->refname, show_date(cb->date, cb->tz,
DATE_MODE(RFC2822)));
oidcpy(&cb->ooid, ooid);
cb->refname, show_date(cb->date, cb->tz,
DATE_MODE(RFC2822)));
oidcpy(&cb->ooid, ooid);
@@
-935,7
+935,7
@@
int read_ref_at(const char *refname, unsigned int flags, timestamp_t at_time, in
if (flags & GET_OID_QUIETLY)
exit(128);
else
if (flags & GET_OID_QUIETLY)
exit(128);
else
- die(
"log for %s is empty"
, refname);
+ die(
_("log for %s is empty")
, refname);
}
if (cb.found_it)
return 0;
}
if (cb.found_it)
return 0;
@@
-1027,7
+1027,7
@@
int ref_transaction_update(struct ref_transaction *transaction,
if ((new_oid && !is_null_oid(new_oid)) ?
check_refname_format(refname, REFNAME_ALLOW_ONELEVEL) :
!refname_is_safe(refname)) {
if ((new_oid && !is_null_oid(new_oid)) ?
check_refname_format(refname, REFNAME_ALLOW_ONELEVEL) :
!refname_is_safe(refname)) {
- strbuf_addf(err,
"refusing to update ref with bad name '%s'"
,
+ strbuf_addf(err,
_("refusing to update ref with bad name '%s'")
,
refname);
return -1;
}
refname);
return -1;
}
@@
-1103,7
+1103,7
@@
int refs_update_ref(struct ref_store *refs, const char *msg,
}
}
if (ret) {
}
}
if (ret) {
- const char *str =
"update_ref failed for ref '%s': %s"
;
+ const char *str =
_("update_ref failed for ref '%s': %s")
;
switch (onerr) {
case UPDATE_REFS_MSG_ON_ERR:
switch (onerr) {
case UPDATE_REFS_MSG_ON_ERR:
@@
-1845,7
+1845,7
@@
int ref_update_reject_duplicates(struct string_list *refnames,
if (!cmp) {
strbuf_addf(err,
if (!cmp) {
strbuf_addf(err,
-
"multiple updates for ref '%s' not allowed"
,
+
_("multiple updates for ref '%s' not allowed")
,
refnames->items[i].string);
return 1;
} else if (cmp > 0) {
refnames->items[i].string);
return 1;
} else if (cmp > 0) {
@@
-1973,13
+1973,13
@@
int refs_verify_refname_available(struct ref_store *refs,
continue;
if (!refs_read_raw_ref(refs, dirname.buf, &oid, &referent, &type)) {
continue;
if (!refs_read_raw_ref(refs, dirname.buf, &oid, &referent, &type)) {
- strbuf_addf(err,
"'%s' exists; cannot create '%s'"
,
+ strbuf_addf(err,
_("'%s' exists; cannot create '%s'")
,
dirname.buf, refname);
goto cleanup;
}
if (extras && string_list_has_string(extras, dirname.buf)) {
dirname.buf, refname);
goto cleanup;
}
if (extras && string_list_has_string(extras, dirname.buf)) {
- strbuf_addf(err,
"cannot process '%s' and '%s' at the same time"
,
+ strbuf_addf(err,
_("cannot process '%s' and '%s' at the same time")
,
refname, dirname.buf);
goto cleanup;
}
refname, dirname.buf);
goto cleanup;
}
@@
-2003,7
+2003,7
@@
int refs_verify_refname_available(struct ref_store *refs,
string_list_has_string(skip, iter->refname))
continue;
string_list_has_string(skip, iter->refname))
continue;
- strbuf_addf(err,
"'%s' exists; cannot create '%s'"
,
+ strbuf_addf(err,
_("'%s' exists; cannot create '%s'")
,
iter->refname, refname);
ref_iterator_abort(iter);
goto cleanup;
iter->refname, refname);
ref_iterator_abort(iter);
goto cleanup;
@@
-2014,7
+2014,7
@@
int refs_verify_refname_available(struct ref_store *refs,
extra_refname = find_descendant_ref(dirname.buf, extras, skip);
if (extra_refname)
extra_refname = find_descendant_ref(dirname.buf, extras, skip);
if (extra_refname)
- strbuf_addf(err,
"cannot process '%s' and '%s' at the same time"
,
+ strbuf_addf(err,
_("cannot process '%s' and '%s' at the same time")
,
refname, extra_refname);
else
ret = 0;
refname, extra_refname);
else
ret = 0;
diff --git
a/t/t1400-update-ref.sh
b/t/t1400-update-ref.sh
index 05e68a6671570009b129241f380b98885f741afe..7c8df2095574f66f6d434f7717228f6f76a2a908 100755
(executable)
--- a/
t/t1400-update-ref.sh
+++ b/
t/t1400-update-ref.sh
@@
-390,7
+390,7
@@
test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history wit
test_when_finished "rm -f o e" &&
git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
test $B = $(cat o) &&
test_when_finished "rm -f o e" &&
git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e &&
test $B = $(cat o) &&
- test
"warning: log for ref $m has gap after $gd" = "$(cat e)"
+ test
_i18ngrep -F "warning: log for ref $m has gap after $gd" e
'
test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
test_when_finished "rm -f o e" &&
'
test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
test_when_finished "rm -f o e" &&
@@
-408,7
+408,7
@@
test_expect_success 'Query "master@{2005-05-28}" (past end of history)' '
test_when_finished "rm -f o e" &&
git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
test $D = $(cat o) &&
test_when_finished "rm -f o e" &&
git rev-parse --verify "master@{2005-05-28}" >o 2>e &&
test $D = $(cat o) &&
- test
"warning: log for ref $m unexpectedly ended on $ld" = "$(cat e)"
+ test
_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e
'
rm -f .git/$m .git/logs/$m expect
'
rm -f .git/$m .git/logs/$m expect
@@
-462,7
+462,7
@@
test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER
test_expect_success 'given old value for missing pseudoref, do not create' '
test_must_fail git update-ref PSEUDOREF $A $B 2>err &&
test_path_is_missing .git/PSEUDOREF &&
test_expect_success 'given old value for missing pseudoref, do not create' '
test_must_fail git update-ref PSEUDOREF $A $B 2>err &&
test_path_is_missing .git/PSEUDOREF &&
- grep "could not read ref" err
+
test_i18n
grep "could not read ref" err
'
test_expect_success 'create pseudoref' '
'
test_expect_success 'create pseudoref' '
@@
-483,7
+483,7
@@
test_expect_success 'overwrite pseudoref with correct old value' '
test_expect_success 'do not overwrite pseudoref with wrong old value' '
test_must_fail git update-ref PSEUDOREF $D $E 2>err &&
test $C = $(cat .git/PSEUDOREF) &&
test_expect_success 'do not overwrite pseudoref with wrong old value' '
test_must_fail git update-ref PSEUDOREF $D $E 2>err &&
test $C = $(cat .git/PSEUDOREF) &&
- grep "unexpected object ID" err
+
test_i18n
grep "unexpected object ID" err
'
test_expect_success 'delete pseudoref' '
'
test_expect_success 'delete pseudoref' '
@@
-495,7
+495,7
@@
test_expect_success 'do not delete pseudoref with wrong old value' '
git update-ref PSEUDOREF $A &&
test_must_fail git update-ref -d PSEUDOREF $B 2>err &&
test $A = $(cat .git/PSEUDOREF) &&
git update-ref PSEUDOREF $A &&
test_must_fail git update-ref -d PSEUDOREF $B 2>err &&
test $A = $(cat .git/PSEUDOREF) &&
- grep "unexpected object ID" err
+
test_i18n
grep "unexpected object ID" err
'
test_expect_success 'delete pseudoref with correct old value' '
'
test_expect_success 'delete pseudoref with correct old value' '
@@
-512,7
+512,7
@@
test_expect_success 'do not overwrite pseudoref with old OID zero' '
test_when_finished git update-ref -d PSEUDOREF &&
test_must_fail git update-ref PSEUDOREF $B $Z 2>err &&
test $A = $(cat .git/PSEUDOREF) &&
test_when_finished git update-ref -d PSEUDOREF &&
test_must_fail git update-ref PSEUDOREF $B $Z 2>err &&
test $A = $(cat .git/PSEUDOREF) &&
- grep "already exists" err
+
test_i18n
grep "already exists" err
'
# Test --stdin
'
# Test --stdin
@@
-650,7
+650,7
@@
test_expect_success 'stdin fails with duplicate refs' '
create $a $m
EOF
test_must_fail git update-ref --stdin <stdin 2>err &&
create $a $m
EOF
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
+
test_i18n
grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
'
test_expect_success 'stdin create ref works' '
'
test_expect_success 'stdin create ref works' '
@@
-1052,7
+1052,7
@@
test_expect_success 'stdin -z fails option with unknown name' '
test_expect_success 'stdin -z fails with duplicate refs' '
printf $F "create $a" "$m" "create $b" "$m" "create $a" "$m" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
test_expect_success 'stdin -z fails with duplicate refs' '
printf $F "create $a" "$m" "create $b" "$m" "create $a" "$m" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
+
test_i18n
grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
'
test_expect_success 'stdin -z create ref works' '
'
test_expect_success 'stdin -z create ref works' '
@@
-1283,7
+1283,7
@@
test_expect_success 'fails with duplicate HEAD update' '
update HEAD $B
EOF
test_must_fail git update-ref --stdin <stdin 2>err &&
update HEAD $B
EOF
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: multiple updates for '\''HEAD'\'' (including one via its referent .refs/heads/target1.) are not allowed" err &&
+
test_i18n
grep "fatal: multiple updates for '\''HEAD'\'' (including one via its referent .refs/heads/target1.) are not allowed" err &&
echo "refs/heads/target1" >expect &&
git symbolic-ref HEAD >actual &&
test_cmp expect actual &&
echo "refs/heads/target1" >expect &&
git symbolic-ref HEAD >actual &&
test_cmp expect actual &&
@@
-1300,7
+1300,7
@@
test_expect_success 'fails with duplicate ref update via symref' '
update refs/heads/symref2 $B
EOF
test_must_fail git update-ref --stdin <stdin 2>err &&
update refs/heads/symref2 $B
EOF
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: multiple updates for '\''refs/heads/target2'\'' (including one via symref .refs/heads/symref2.) are not allowed" err &&
+
test_i18n
grep "fatal: multiple updates for '\''refs/heads/target2'\'' (including one via symref .refs/heads/symref2.) are not allowed" err &&
echo "refs/heads/target2" >expect &&
git symbolic-ref refs/heads/symref2 >actual &&
test_cmp expect actual &&
echo "refs/heads/target2" >expect &&
git symbolic-ref refs/heads/symref2 >actual &&
test_cmp expect actual &&
diff --git
a/t/t1404-update-ref-errors.sh
b/t/t1404-update-ref-errors.sh
index 3a887b511340b50a0cadcf1968a8c0986d67d66c..2a42a589a42cb9c086561be2df5540fa72af2ddf 100755
(executable)
--- a/
t/t1404-update-ref-errors.sh
+++ b/
t/t1404-update-ref-errors.sh
@@
-27,7
+27,7
@@
test_update_rejected () {
fi &&
printf "create $prefix/%s $C\n" $create >input &&
test_must_fail git update-ref --stdin <input 2>output.err &&
fi &&
printf "create $prefix/%s $C\n" $create >input &&
test_must_fail git update-ref --stdin <input 2>output.err &&
- grep -F "$error" output.err &&
+
test_i18n
grep -F "$error" output.err &&
git for-each-ref $prefix >actual &&
test_cmp unchanged actual
}
git for-each-ref $prefix >actual &&
test_cmp unchanged actual
}
@@
-103,7
+103,7
@@
df_test() {
printf "%s\n" "delete $delname" "create $addname $D"
fi >commands &&
test_must_fail git update-ref --stdin <commands 2>output.err &&
printf "%s\n" "delete $delname" "create $addname $D"
fi >commands &&
test_must_fail git update-ref --stdin <commands 2>output.err &&
- test_cmp expected-err output.err &&
+ test_
i18n
cmp expected-err output.err &&
printf "%s\n" "$C $delref" >expected-refs &&
git for-each-ref --format="%(objectname) %(refname)" $prefix/r >actual-refs &&
test_cmp expected-refs actual-refs
printf "%s\n" "$C $delref" >expected-refs &&
git for-each-ref --format="%(objectname) %(refname)" $prefix/r >actual-refs &&
test_cmp expected-refs actual-refs
diff --git
a/t/t3210-pack-refs.sh
b/t/t3210-pack-refs.sh
index afa27ffe2d869a5e7fdf8318d5b9957208a96c52..7e95713f9e6390a0f87b2befab542a7779dda025 100755
(executable)
--- a/
t/t3210-pack-refs.sh
+++ b/
t/t3210-pack-refs.sh
@@
-186,7
+186,7
@@
test_expect_success 'notice d/f conflict with existing directory' '
test_expect_success 'existing directory reports concrete ref' '
test_must_fail git branch foo 2>stderr &&
test_expect_success 'existing directory reports concrete ref' '
test_must_fail git branch foo 2>stderr &&
- grep refs/heads/foo/bar/baz stderr
+
test_i18n
grep refs/heads/foo/bar/baz stderr
'
test_expect_success 'notice d/f conflict with existing ref' '
'
test_expect_success 'notice d/f conflict with existing ref' '
diff --git
a/t/t3310-notes-merge-manual-resolve.sh
b/t/t3310-notes-merge-manual-resolve.sh
index 9c1bf6eb3d46f31c0e1816508dcc8fee4699f823..68436eed82101cdfcc7f93fea0681083b546cf2a 100755
(executable)
--- a/
t/t3310-notes-merge-manual-resolve.sh
+++ b/
t/t3310-notes-merge-manual-resolve.sh
@@
-541,9
+541,9
@@
EOF
test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
test "$(git rev-parse refs/notes/m)" != "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
# Mention refs/notes/m, and its current and expected value in output
test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
test "$(git rev-parse refs/notes/m)" != "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
# Mention refs/notes/m, and its current and expected value in output
- grep -q "refs/notes/m" output &&
- grep -q "$(git rev-parse refs/notes/m)" output &&
- grep -q "$(git rev-parse NOTES_MERGE_PARTIAL^1)" output &&
+
test_i18n
grep -q "refs/notes/m" output &&
+
test_i18n
grep -q "$(git rev-parse refs/notes/m)" output &&
+
test_i18n
grep -q "$(git rev-parse NOTES_MERGE_PARTIAL^1)" output &&
# Verify that other notes refs has not changed (w, x, y and z)
verify_notes w &&
verify_notes x &&
# Verify that other notes refs has not changed (w, x, y and z)
verify_notes w &&
verify_notes x &&
diff --git
a/t/t5505-remote.sh
b/t/t5505-remote.sh
index a6c0178f3af6c3e3f01816197e51e9bca546b00a..ca4c222743782d036c30255c838dd5f4cad020e5 100755
(executable)
--- a/
t/t5505-remote.sh
+++ b/
t/t5505-remote.sh
@@
-876,7
+876,7
@@
test_expect_success 'remote prune to cause a dangling symref' '
cd eight &&
test_must_fail git branch nomore origin
) 2>err &&
cd eight &&
test_must_fail git branch nomore origin
) 2>err &&
- grep "dangling symref" err
+
test_i18n
grep "dangling symref" err
'
test_expect_success 'show empty remote' '
'
test_expect_success 'show empty remote' '