/*!
 * The POSIX core below - `assertPath`, `normalizeStringPosix` and the body of
 * `normalize` - comes from path-browserify, which extracted it from Node.js.
 * Reformatted to this project's style (`const`/`let`, no semicolons); the
 * algorithm is unchanged.
 *
 * SPDX-License-Identifier: MIT
 * Copyright (c) 2013 James Halliday
 * Copyright Joyent, Inc. and other Node contributors.
 *
 * @see https://github.com/browserify/path-browserify
 *
 * The Windows handling is this project's own, added in #2302. path-browserify
 * is the POSIX part of `path` only, so `normalize` and `join` are wrapped with:
 *   - Backslashes are normalised to forward slashes before processing.
 *   - Drive-letter prefixes (e.g. "C:") are detected and preserved through
 *     normalisation, so absolute Windows paths are handled correctly.
 *   - A drive-letter argument passed to join() resets the accumulated path,
 *     matching Node behaviour and handling worktree gitdir paths properly.
 *
 * Limitation: UNC paths (e.g. \\server\share) are not supported. The leading
 *   backslashes are normalised to forward slashes and then collapsed by
 *   normalizeStringPosix, losing the UNC root. Git on Windows works with
 *   drive-letter paths, so this is not expected to be a practical issue.
 */
