@@ -1006,6 +1006,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
1006
1006
{
1007
1007
struct strbuf ref_file = STRBUF_INIT ;
1008
1008
struct ref_lock * lock ;
1009
+ int ignore_errno ;
1009
1010
1010
1011
files_assert_main_repository (refs , "lock_ref_oid_basic" );
1011
1012
assert (err );
@@ -1032,9 +1033,8 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
1032
1033
goto error_return ;
1033
1034
}
1034
1035
1035
- if (refs_read_ref_full (& refs -> base , lock -> ref_name ,
1036
- 0 ,
1037
- & lock -> old_oid , NULL ))
1036
+ if (!refs_werrres_ref_unsafe (& refs -> base , lock -> ref_name , 0 ,
1037
+ & lock -> old_oid , NULL , & ignore_errno ))
1038
1038
oidclr (& lock -> old_oid );
1039
1039
goto out ;
1040
1040
@@ -1397,6 +1397,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
1397
1397
struct strbuf tmp_renamed_log = STRBUF_INIT ;
1398
1398
int log , ret ;
1399
1399
struct strbuf err = STRBUF_INIT ;
1400
+ int ignore_errno ;
1400
1401
1401
1402
files_reflog_path (refs , & sb_oldref , oldrefname );
1402
1403
files_reflog_path (refs , & sb_newref , newrefname );
@@ -1454,9 +1455,9 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
1454
1455
* the safety anyway; we want to delete the reference whatever
1455
1456
* its current value.
1456
1457
*/
1457
- if (!copy && ! refs_read_ref_full (& refs -> base , newrefname ,
1458
- RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE ,
1459
- NULL , NULL ) &&
1458
+ if (!copy && refs_werrres_ref_unsafe (& refs -> base , newrefname ,
1459
+ RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE ,
1460
+ NULL , NULL , & ignore_errno ) &&
1460
1461
refs_delete_ref (& refs -> base , NULL , newrefname ,
1461
1462
NULL , REF_NO_DEREF )) {
1462
1463
if (errno == EISDIR ) {
@@ -1868,9 +1869,12 @@ static void update_symref_reflog(struct files_ref_store *refs,
1868
1869
{
1869
1870
struct strbuf err = STRBUF_INIT ;
1870
1871
struct object_id new_oid ;
1872
+ int ignore_errno ;
1873
+
1871
1874
if (logmsg &&
1872
- !refs_read_ref_full (& refs -> base , target ,
1873
- RESOLVE_REF_READING , & new_oid , NULL ) &&
1875
+ refs_werrres_ref_unsafe (& refs -> base , target ,
1876
+ RESOLVE_REF_READING , & new_oid , NULL ,
1877
+ & ignore_errno ) &&
1874
1878
files_log_ref_write (refs , refname , & lock -> old_oid ,
1875
1879
& new_oid , logmsg , 0 , & err )) {
1876
1880
error ("%s" , err .buf );
@@ -2144,6 +2148,7 @@ static int files_reflog_iterator_advance(struct ref_iterator *ref_iterator)
2144
2148
(struct files_reflog_iterator * )ref_iterator ;
2145
2149
struct dir_iterator * diter = iter -> dir_iterator ;
2146
2150
int ok ;
2151
+ int ignore_errno ;
2147
2152
2148
2153
while ((ok = dir_iterator_advance (diter )) == ITER_OK ) {
2149
2154
int flags ;
@@ -2155,9 +2160,10 @@ static int files_reflog_iterator_advance(struct ref_iterator *ref_iterator)
2155
2160
if (ends_with (diter -> basename , ".lock" ))
2156
2161
continue ;
2157
2162
2158
- if (refs_read_ref_full (iter -> ref_store ,
2159
- diter -> relative_path , 0 ,
2160
- & iter -> oid , & flags )) {
2163
+ if (!refs_werrres_ref_unsafe (iter -> ref_store ,
2164
+ diter -> relative_path , 0 ,
2165
+ & iter -> oid , & flags ,
2166
+ & ignore_errno )) {
2161
2167
error ("bad ref for %s" , diter -> path .buf );
2162
2168
continue ;
2163
2169
}
@@ -2501,9 +2507,11 @@ static int lock_ref_for_update(struct files_ref_store *refs,
2501
2507
* the transaction, so we have to read it here
2502
2508
* to record and possibly check old_oid:
2503
2509
*/
2504
- if (refs_read_ref_full (& refs -> base ,
2505
- referent .buf , 0 ,
2506
- & lock -> old_oid , NULL )) {
2510
+ int ignore_errno ;
2511
+ if (!refs_werrres_ref_unsafe (& refs -> base ,
2512
+ referent .buf , 0 ,
2513
+ & lock -> old_oid , NULL ,
2514
+ & ignore_errno )) {
2507
2515
if (update -> flags & REF_HAVE_OLD ) {
2508
2516
strbuf_addf (err , "cannot lock ref '%s': "
2509
2517
"error reading reference" ,
0 commit comments