Re: [PATCH v1/RFC 1/1] 'git clone <url> C:\cygwin\home\USER\repo' is working (again)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 28, 2018, 04:12 UTC
- Message-ID
- <xmqqwooxsuvf.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.1811271346550.41@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 14 quoted lines
> It takes a little folding and knotting of the brain to understand that
> this `!skip_dos_drive_prefix(&pos)` has *nothing* to do with the comment
> `unc paths` nor with the test whether the paths starts with two directory
> separators.
>
> As a consequence, I would highly suggest to turn this into:
>
> if (skip_dos_drive_prefix(&pos))
> ; /* absolute path with DOS drive prefix */
> /* unc paths */
> else if (is_dir_sep(pos[0]) && is_dir_sep(pos[1])) {
>
> That makes the code a lot easier to understand, and as a consequence a lot
> harder to mess up in the future.Excellent. With or without "unc paths" comment, the separation does make the logic more clear.