diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-01-21 08:29:00 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-01-21 08:29:00 -0800 |
| commit | 39d66ddffd2b1dda275a6dd61df3eebac35fcf8a (patch) | |
| tree | 3b18ec048f1154499995d5bf91b67ff9213198c8 /lockfile.c | |
| parent | bc5cbbe24650f4234ed4ed2c21c58058f96dfcac (diff) | |
| parent | aa7b8864d841f16044b0d79fce5baaec1830b3e3 (diff) | |
| download | git-39d66ddffd2b1dda275a6dd61df3eebac35fcf8a.tar.xz | |
Merge branch 'js/prep-symlink-windows'
Further preparation to upstream symbolic link support on Windows.
* js/prep-symlink-windows:
trim_last_path_component(): avoid hard-coding the directory separator
strbuf_readlink(): support link targets that exceed 2*PATH_MAX
strbuf_readlink(): avoid calling `readlink()` twice in corner-cases
init: do parse _all_ core.* settings early
mingw: do resolve symlinks in `getcwd()`
Diffstat (limited to 'lockfile.c')
| -rw-r--r-- | lockfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lockfile.c b/lockfile.c index 1d5ed01682..67082a9caa 100644 --- a/lockfile.c +++ b/lockfile.c @@ -19,14 +19,14 @@ static void trim_last_path_component(struct strbuf *path) int i = path->len; /* back up past trailing slashes, if any */ - while (i && path->buf[i - 1] == '/') + while (i && is_dir_sep(path->buf[i - 1])) i--; /* * then go backwards until a slash, or the beginning of the * string */ - while (i && path->buf[i - 1] != '/') + while (i && !is_dir_sep(path->buf[i - 1])) i--; strbuf_setlen(path, i); |
