Will replace the one in 'pu'. A few things I noticed:
* Documentation and messages talk about "working tree" and "working
directory" when they refer to "worktree", which is not a normal
"working tree". I think this was done as an attempt to avoid
being too precise and technical in phrasing, but I suspect that
is a false reader-friendliness. At least, "working directory" in
messages should be "worktree", e.g.
wt = find_worktree(...);
if (!wt)
die("'%s' is not a working directory", av[0]); does not make much sense (imagine "git wt lock ." and being told
that '.' is not a working directory).
* You are probably trying to be frugal by not introducing a
separate bit for is_lock_checked to struct worktre and instead
using a sentinel value for lock_reason, but I think that is a
false economy, after seeing that you have to cast away constness
in number of places and having to be extra careful not to free
that sentinel value.
Thanks.