diff options
Diffstat (limited to 'worktree.c')
-rw-r--r-- | worktree.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/worktree.c b/worktree.c index 70015629dc..f5da7d286d 100644 --- a/worktree.c +++ b/worktree.c @@ -31,7 +31,7 @@ static void add_head_info(struct worktree *wt) target = refs_resolve_ref_unsafe(get_worktree_ref_store(wt), "HEAD", 0, - wt->head_sha1, &flags); + &wt->head_oid, &flags); if (!target) return; @@ -327,7 +327,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); - if ((flags & REF_ISSYMREF) && !strcmp(symref_target, target)) { + if ((flags & REF_ISSYMREF) && + symref_target && !strcmp(symref_target, target)) { existing = wt; break; } |