Re: [PATCH v3 5/7] worktree: teach `list --porcelain` to annotate locked worktree
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 21, 2021, 03:18 UTC
- Message-ID
- <xmqqsg6vc706.fsf@gitster.c.googlers.com>
- In-Reply-To
- <be24c164-3d03-145f-abc0-4f41ed225b4e@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
> l.starts_with("locked ")
> rather than having to do
> l.starts_with("locked ") || l == "locked\n"l.regexp_matches("^locked[\s\n]")?Jokes aside, isn't the "space separated list" meant to be used more like:
attrs = l.splitAtEach(" ")
if "locked" in attrs:
... yeah it is locked ...
if "broken" in attrs:
... ouch, it is broken ...so I am not sure if having always a trailing whitespace is a good idea to begin with (the last element may become an empty string if the splitting is done naively).