diff options
Diffstat (limited to 'worktree.c')
-rw-r--r-- | worktree.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/worktree.c b/worktree.c index 092a4f92ad..2c155b1015 100644 --- a/worktree.c +++ b/worktree.c @@ -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), "HEAD", 0, - &wt->head_oid, &flags); + &wt->head_oid, &flags, + &ignore_errno); if (!target) return; @@ -418,6 +420,7 @@ const struct worktree *find_shared_symref(const char *symref, const char *symref_target; struct ref_store *refs; int flags; + int ignore_errno; if (wt->is_bare) continue; @@ -435,7 +438,8 @@ const struct worktree *find_shared_symref(const char *symref, refs = get_worktree_ref_store(wt); symref_target = refs_resolve_ref_unsafe(refs, symref, 0, - NULL, &flags); + NULL, &flags, + &ignore_errno); if ((flags & REF_ISSYMREF) && symref_target && !strcmp(symref_target, target)) { existing = wt; @@ -563,16 +567,17 @@ int other_head_refs(each_ref_fn fn, void *cb_data) struct worktree *wt = *p; struct object_id oid; int flag; + int ignore_errno; if (wt->is_current) continue; strbuf_reset(&refname); strbuf_worktree_ref(wt, &refname, "HEAD"); - if (!refs_read_ref_full(get_main_ref_store(the_repository), - refname.buf, - RESOLVE_REF_READING, - &oid, &flag)) + if (refs_resolve_ref_unsafe(get_main_ref_store(the_repository), + refname.buf, + RESOLVE_REF_READING, + &oid, &flag, &ignore_errno)) ret = fn(refname.buf, &oid, flag, cb_data); if (ret) break; |