Skip to content

Commit de881c4

Browse files
jeffhostetlerdscho
authored andcommitted
Merge branch 'fix-v4-fsmonitor-long-paths' into try-v4-fsmonitor
2 parents 284b592 + 0796215 commit de881c4

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

compat/fsmonitor/fsm-health-win32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct fsm_health_data
3232

3333
struct wt_moved
3434
{
35-
wchar_t wpath[MAX_PATH + 1];
35+
wchar_t wpath[MAX_LONG_PATH + 1];
3636
BY_HANDLE_FILE_INFORMATION bhfi;
3737
} wt_moved;
3838
};
@@ -141,8 +141,8 @@ static int has_worktree_moved(struct fsmonitor_daemon_state *state,
141141
return 0;
142142

143143
case CTX_INIT:
144-
if (xutftowcs_path(data->wt_moved.wpath,
145-
state->path_worktree_watch.buf) < 0) {
144+
if (xutftowcs_long_path(data->wt_moved.wpath,
145+
state->path_worktree_watch.buf) < 0) {
146146
error(_("could not convert to wide characters: '%s'"),
147147
state->path_worktree_watch.buf);
148148
return -1;

compat/fsmonitor/fsm-listen-win32.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct one_watch
2525
DWORD count;
2626

2727
struct strbuf path;
28-
wchar_t wpath_longname[MAX_PATH + 1];
28+
wchar_t wpath_longname[MAX_LONG_PATH + 1];
2929
DWORD wpath_longname_len;
3030

3131
HANDLE hDir;
@@ -128,8 +128,8 @@ static int normalize_path_in_utf8(wchar_t *wpath, DWORD wpath_len,
128128
*/
129129
static void check_for_shortnames(struct one_watch *watch)
130130
{
131-
wchar_t buf_in[MAX_PATH + 1];
132-
wchar_t buf_out[MAX_PATH + 1];
131+
wchar_t buf_in[MAX_LONG_PATH + 1];
132+
wchar_t buf_out[MAX_LONG_PATH + 1];
133133
wchar_t *last;
134134
wchar_t *p;
135135

@@ -194,8 +194,8 @@ static enum get_relative_result get_relative_longname(
194194
const wchar_t *wpath, DWORD wpath_len,
195195
wchar_t *wpath_longname, size_t bufsize_wpath_longname)
196196
{
197-
wchar_t buf_in[2 * MAX_PATH + 1];
198-
wchar_t buf_out[MAX_PATH + 1];
197+
wchar_t buf_in[2 * MAX_LONG_PATH + 1];
198+
wchar_t buf_out[MAX_LONG_PATH + 1];
199199
DWORD root_len;
200200
DWORD out_len;
201201

@@ -296,10 +296,10 @@ static struct one_watch *create_watch(struct fsmonitor_daemon_state *state,
296296
FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE;
297297
HANDLE hDir;
298298
DWORD len_longname;
299-
wchar_t wpath[MAX_PATH + 1];
300-
wchar_t wpath_longname[MAX_PATH + 1];
299+
wchar_t wpath[MAX_LONG_PATH + 1];
300+
wchar_t wpath_longname[MAX_LONG_PATH + 1];
301301

302-
if (xutftowcs_path(wpath, path) < 0) {
302+
if (xutftowcs_long_path(wpath, path) < 0) {
303303
error(_("could not convert to wide characters: '%s'"), path);
304304
return NULL;
305305
}
@@ -544,7 +544,7 @@ static int process_worktree_events(struct fsmonitor_daemon_state *state)
544544
struct string_list cookie_list = STRING_LIST_INIT_DUP;
545545
struct fsmonitor_batch *batch = NULL;
546546
const char *p = watch->buffer;
547-
wchar_t wpath_longname[MAX_PATH + 1];
547+
wchar_t wpath_longname[MAX_LONG_PATH + 1];
548548

549549
/*
550550
* If the kernel gets more events than will fit in the kernel

compat/fsmonitor/fsm-settings-win32.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ static enum fsmonitor_reason check_vfs4git(struct repository *r)
7676
*/
7777
static enum fsmonitor_reason check_remote(struct repository *r)
7878
{
79-
wchar_t wpath[MAX_PATH];
80-
wchar_t wfullpath[MAX_PATH];
79+
wchar_t wpath[MAX_LONG_PATH];
80+
wchar_t wfullpath[MAX_LONG_PATH];
8181
size_t wlen;
8282
UINT driveType;
8383

8484
/*
8585
* Do everything in wide chars because the drive letter might be
8686
* a multi-byte sequence. See win32_has_dos_drive_prefix().
8787
*/
88-
if (xutftowcs_path(wpath, r->worktree) < 0)
88+
if (xutftowcs_long_path(wpath, r->worktree) < 0)
8989
return FSMONITOR_REASON_ERROR;
9090

9191
/*
@@ -103,7 +103,7 @@ static enum fsmonitor_reason check_remote(struct repository *r)
103103
* slashes to backslashes. This is essential to get GetDriveTypeW()
104104
* correctly handle some UNC "\\server\share\..." paths.
105105
*/
106-
if (!GetFullPathNameW(wpath, MAX_PATH, wfullpath, NULL))
106+
if (!GetFullPathNameW(wpath, MAX_LONG_PATH, wfullpath, NULL))
107107
return FSMONITOR_REASON_ERROR;
108108

109109
driveType = GetDriveTypeW(wfullpath);

0 commit comments

Comments
 (0)