On Tue, May 10, 2016 at 10:17 AM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote: > Main worktree _is_ different. You can lock a linked worktree but not the > main one, for example. Provide an API for checking that. > > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> > --- > diff --git a/worktree.c b/worktree.c > @@ -238,6 +238,11 @@ struct worktree *find_worktree_by_path(struct worktree **list, > +int is_main_worktree(const struct worktree *wt) > +{ > + return wt && !wt->id; > +} Is or will there ever be a case when it is valid for 'wt' to be NULL? If not, perhaps assert() or die() if given NULL? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html