Skip to content

Commit ccf3cc1

Browse files
avargitster
authored andcommitted
refs API: ignore errno in worktree.c's add_head_info()
The static add_head_info() function is only used indirectly by callers of get_worktrees(), none of whom care about errno, and even if they did having the faked-up one from refs_resolve_ref_unsafe() would only confuse them if they used die_errno() et al. So let's explicitly ignore it here. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ac0986e commit ccf3cc1

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
@@ -28,11 +28,13 @@ static void add_head_info(struct worktree *wt)
2828
{
2929
int flags;
3030
const char *target;
31+
int ignore_errno;
3132

32-
target = refs_resolve_ref_unsafe(get_worktree_ref_store(wt),
33+
target = refs_werrres_ref_unsafe(get_worktree_ref_store(wt),
3334
"HEAD",
3435
0,
35-
&wt->head_oid, &flags);
36+
&wt->head_oid, &flags,
37+
&ignore_errno);
3638
if (!target)
3739
return;
3840

0 commit comments

Comments
 (0)