From: Eric Sunshine Date: Fri, 08 Apr 2016 06:42:58 GMT Subject: Re: [PATCH v3 1/2] refs: add a new function set_worktree_head_symref Message-ID: In-Reply-To: <20160408063713.GA17696@chikuwa.rhe.jp> On Fri, Apr 8, 2016 at 2:37 AM, Kazuki Yamaguchi wrote: > On Thu, Apr 07, 2016 at 05:20:10PM -0400, Eric Sunshine wrote: >> On Sun, Mar 27, 2016 at 10:37 AM, Kazuki Yamaguchi wrote: >> > +int set_worktree_head_symref(const char *gitdir, const char *target) >> > +{ >> > + static struct lock_file head_lock; >> > + struct ref_lock *lock; >> > + struct strbuf err = STRBUF_INIT; >> > + struct strbuf head_path = STRBUF_INIT; >> > + const char *head_rel; >> > + int ret; >> > + >> > + strbuf_addf(&head_path, "%s/HEAD", absolute_path(gitdir)); >> > + if (hold_lock_file_for_update(&head_lock, head_path.buf, >> > + LOCK_NO_DEREF) < 0) { >> > + error("%s", err.buf); >> >> 'err' has not been populated at this point, so I suspect that this >> error message is likely to be rather uninformative. > > Yes, unable_to_lock_message() is missing. Thank you for pointing it out. You're welcome. As this patch is already in Junio's "next" branch, if you post a fix, it should be incremental atop "ky/branch-m-worktree", rather than as a re-roll of this series.