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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Oct 16, 2021 at 11:39 UTC
ccf3cc1b189f732cb1e99b08bda37e92a896047f
1 file changed
+4
-2
worktree.c
+4
-2
@@ -28,11 +28,13 @@ static void add_head_info(struct worktree *wt)
28
{
29
int flags;
30
const char *target;
31
+ int ignore_errno;
32
32
- target = refs_resolve_ref_unsafe(get_worktree_ref_store(wt),
33
+ target = refs_werrres_ref_unsafe(get_worktree_ref_store(wt),
34
"HEAD",
35
0,
35
- &wt->head_oid, &flags);
36
+ &wt->head_oid, &flags,
37
+ &ignore_errno);
38
if (!target)
39
return;
40