@@ -188,7 +188,7 @@ int ref_resolves_to_object(const char *refname,
188
188
if (flags & REF_ISBROKEN )
189
189
return 0 ;
190
190
if (!has_sha1_file (oid -> hash )) {
191
- error ("%s does not point to a valid object!" , refname );
191
+ error (_ ( "%s does not point to a valid object!" ) , refname );
192
192
return 0 ;
193
193
}
194
194
return 1 ;
@@ -567,9 +567,9 @@ int expand_ref(const char *str, int len, struct object_id *oid, char **ref)
567
567
if (!warn_ambiguous_refs )
568
568
break ;
569
569
} else if ((flag & REF_ISSYMREF ) && strcmp (fullref .buf , "HEAD" )) {
570
- warning ("ignoring dangling symref %s" , fullref .buf );
570
+ warning (_ ( "ignoring dangling symref %s" ) , fullref .buf );
571
571
} else if ((flag & REF_ISBROKEN ) && strchr (fullref .buf , '/' )) {
572
- warning ("ignoring broken ref %s" , fullref .buf );
572
+ warning (_ ( "ignoring broken ref %s" ) , fullref .buf );
573
573
}
574
574
}
575
575
strbuf_release (& fullref );
@@ -673,7 +673,7 @@ static int write_pseudoref(const char *pseudoref, const struct object_id *oid,
673
673
fd = hold_lock_file_for_update_timeout (& lock , filename , 0 ,
674
674
get_files_ref_lock_timeout_ms ());
675
675
if (fd < 0 ) {
676
- strbuf_addf (err , "could not open '%s' for writing: %s" ,
676
+ strbuf_addf (err , _ ( "could not open '%s' for writing: %s" ) ,
677
677
filename , strerror (errno ));
678
678
goto done ;
679
679
}
@@ -683,26 +683,26 @@ static int write_pseudoref(const char *pseudoref, const struct object_id *oid,
683
683
684
684
if (read_ref (pseudoref , & actual_old_oid )) {
685
685
if (!is_null_oid (old_oid )) {
686
- strbuf_addf (err , "could not read ref '%s'" ,
686
+ strbuf_addf (err , _ ( "could not read ref '%s'" ) ,
687
687
pseudoref );
688
688
rollback_lock_file (& lock );
689
689
goto done ;
690
690
}
691
691
} else if (is_null_oid (old_oid )) {
692
- strbuf_addf (err , "ref '%s' already exists" ,
692
+ strbuf_addf (err , _ ( "ref '%s' already exists" ) ,
693
693
pseudoref );
694
694
rollback_lock_file (& lock );
695
695
goto done ;
696
696
} else if (oidcmp (& actual_old_oid , old_oid )) {
697
- strbuf_addf (err , "unexpected object ID when writing '%s'" ,
697
+ strbuf_addf (err , _ ( "unexpected object ID when writing '%s'" ) ,
698
698
pseudoref );
699
699
rollback_lock_file (& lock );
700
700
goto done ;
701
701
}
702
702
}
703
703
704
704
if (write_in_full (fd , buf .buf , buf .len ) < 0 ) {
705
- strbuf_addf (err , "could not write to '%s'" , filename );
705
+ strbuf_addf (err , _ ( "could not write to '%s'" ) , filename );
706
706
rollback_lock_file (& lock );
707
707
goto done ;
708
708
}
@@ -734,9 +734,9 @@ static int delete_pseudoref(const char *pseudoref, const struct object_id *old_o
734
734
return -1 ;
735
735
}
736
736
if (read_ref (pseudoref , & actual_old_oid ))
737
- die ("could not read ref '%s'" , pseudoref );
737
+ die (_ ( "could not read ref '%s'" ) , pseudoref );
738
738
if (oidcmp (& actual_old_oid , old_oid )) {
739
- error ("unexpected object ID when deleting '%s'" ,
739
+ error (_ ( "unexpected object ID when deleting '%s'" ) ,
740
740
pseudoref );
741
741
rollback_lock_file (& lock );
742
742
return -1 ;
@@ -871,13 +871,13 @@ static int read_ref_at_ent(struct object_id *ooid, struct object_id *noid,
871
871
if (!is_null_oid (& cb -> ooid )) {
872
872
oidcpy (cb -> oid , noid );
873
873
if (oidcmp (& cb -> ooid , noid ))
874
- warning ("log for ref %s has gap after %s" ,
874
+ warning (_ ( "log for ref %s has gap after %s" ) ,
875
875
cb -> refname , show_date (cb -> date , cb -> tz , DATE_MODE (RFC2822 )));
876
876
}
877
877
else if (cb -> date == cb -> at_time )
878
878
oidcpy (cb -> oid , noid );
879
879
else if (oidcmp (noid , cb -> oid ))
880
- warning ("log for ref %s unexpectedly ended on %s" ,
880
+ warning (_ ( "log for ref %s unexpectedly ended on %s" ) ,
881
881
cb -> refname , show_date (cb -> date , cb -> tz ,
882
882
DATE_MODE (RFC2822 )));
883
883
oidcpy (& cb -> ooid , ooid );
@@ -935,7 +935,7 @@ int read_ref_at(const char *refname, unsigned int flags, timestamp_t at_time, in
935
935
if (flags & GET_OID_QUIETLY )
936
936
exit (128 );
937
937
else
938
- die ("log for %s is empty" , refname );
938
+ die (_ ( "log for %s is empty" ) , refname );
939
939
}
940
940
if (cb .found_it )
941
941
return 0 ;
@@ -1027,7 +1027,7 @@ int ref_transaction_update(struct ref_transaction *transaction,
1027
1027
if ((new_oid && !is_null_oid (new_oid )) ?
1028
1028
check_refname_format (refname , REFNAME_ALLOW_ONELEVEL ) :
1029
1029
!refname_is_safe (refname )) {
1030
- strbuf_addf (err , "refusing to update ref with bad name '%s'" ,
1030
+ strbuf_addf (err , _ ( "refusing to update ref with bad name '%s'" ) ,
1031
1031
refname );
1032
1032
return -1 ;
1033
1033
}
@@ -1103,7 +1103,7 @@ int refs_update_ref(struct ref_store *refs, const char *msg,
1103
1103
}
1104
1104
}
1105
1105
if (ret ) {
1106
- const char * str = "update_ref failed for ref '%s': %s" ;
1106
+ const char * str = _ ( "update_ref failed for ref '%s': %s" ) ;
1107
1107
1108
1108
switch (onerr ) {
1109
1109
case UPDATE_REFS_MSG_ON_ERR :
@@ -1845,7 +1845,7 @@ int ref_update_reject_duplicates(struct string_list *refnames,
1845
1845
1846
1846
if (!cmp ) {
1847
1847
strbuf_addf (err ,
1848
- "multiple updates for ref '%s' not allowed" ,
1848
+ _ ( "multiple updates for ref '%s' not allowed" ) ,
1849
1849
refnames -> items [i ].string );
1850
1850
return 1 ;
1851
1851
} else if (cmp > 0 ) {
@@ -1973,13 +1973,13 @@ int refs_verify_refname_available(struct ref_store *refs,
1973
1973
continue ;
1974
1974
1975
1975
if (!refs_read_raw_ref (refs , dirname .buf , & oid , & referent , & type )) {
1976
- strbuf_addf (err , "'%s' exists; cannot create '%s'" ,
1976
+ strbuf_addf (err , _ ( "'%s' exists; cannot create '%s'" ) ,
1977
1977
dirname .buf , refname );
1978
1978
goto cleanup ;
1979
1979
}
1980
1980
1981
1981
if (extras && string_list_has_string (extras , dirname .buf )) {
1982
- strbuf_addf (err , "cannot process '%s' and '%s' at the same time" ,
1982
+ strbuf_addf (err , _ ( "cannot process '%s' and '%s' at the same time" ) ,
1983
1983
refname , dirname .buf );
1984
1984
goto cleanup ;
1985
1985
}
@@ -2003,7 +2003,7 @@ int refs_verify_refname_available(struct ref_store *refs,
2003
2003
string_list_has_string (skip , iter -> refname ))
2004
2004
continue ;
2005
2005
2006
- strbuf_addf (err , "'%s' exists; cannot create '%s'" ,
2006
+ strbuf_addf (err , _ ( "'%s' exists; cannot create '%s'" ) ,
2007
2007
iter -> refname , refname );
2008
2008
ref_iterator_abort (iter );
2009
2009
goto cleanup ;
@@ -2014,7 +2014,7 @@ int refs_verify_refname_available(struct ref_store *refs,
2014
2014
2015
2015
extra_refname = find_descendant_ref (dirname .buf , extras , skip );
2016
2016
if (extra_refname )
2017
- strbuf_addf (err , "cannot process '%s' and '%s' at the same time" ,
2017
+ strbuf_addf (err , _ ( "cannot process '%s' and '%s' at the same time" ) ,
2018
2018
refname , extra_refname );
2019
2019
else
2020
2020
ret = 0 ;
0 commit comments