Skip to content

Commit 0506eb7

Browse files
avargitster
authored andcommitted
refs API: ignore errno in worktree.c's find_shared_symref()
There are only handful of callers of find_shared_symref(), none of whom care about errno, so let's migrate to the non-errno-propagating version of refs_resolve_ref_unsafe() and explicitly ignore errno here. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ccf3cc1 commit 0506eb7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

worktree.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ const struct worktree *find_shared_symref(const char *symref,
420420
const char *symref_target;
421421
struct ref_store *refs;
422422
int flags;
423+
int ignore_errno;
423424

424425
if (wt->is_bare)
425426
continue;
@@ -436,8 +437,9 @@ const struct worktree *find_shared_symref(const char *symref,
436437
}
437438

438439
refs = get_worktree_ref_store(wt);
439-
symref_target = refs_resolve_ref_unsafe(refs, symref, 0,
440-
NULL, &flags);
440+
symref_target = refs_werrres_ref_unsafe(refs, symref, 0,
441+
NULL, &flags,
442+
&ignore_errno);
441443
if ((flags & REF_ISSYMREF) &&
442444
symref_target && !strcmp(symref_target, target)) {
443445
existing = wt;

0 commit comments

Comments
 (0)