]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs API: ignore errno in worktree.c's add_head_info()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sat, 16 Oct 2021 09:39:18 +0000 (11:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 16 Oct 2021 18:17:03 +0000 (11:17 -0700)
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>
worktree.c

index cfffcdb62b3c13ad364bcf599bcfa56b09ae1608..fa988ee978ffdafb6703668de666b32113192fbe 100644 (file)
@@ -28,11 +28,13 @@ static void add_head_info(struct worktree *wt)
 {
        int flags;
        const char *target;
+       int ignore_errno;
 
-       target = refs_resolve_ref_unsafe(get_worktree_ref_store(wt),
+       target = refs_werrres_ref_unsafe(get_worktree_ref_store(wt),
                                         "HEAD",
                                         0,
-                                        &wt->head_oid, &flags);
+                                        &wt->head_oid, &flags,
+                                        &ignore_errno);
        if (!target)
                return;