@@ -121,87 +121,6 @@ static int handle_client(void *data,
121
121
return result ;
122
122
}
123
123
124
- #define FSMONITOR_COOKIE_PREFIX ".fsmonitor-daemon-"
125
-
126
- enum fsmonitor_path_type fsmonitor_classify_path_workdir_relative (
127
- const char * rel )
128
- {
129
- if (fspathncmp (rel , ".git" , 4 ))
130
- return IS_WORKDIR_PATH ;
131
- rel += 4 ;
132
-
133
- if (!* rel )
134
- return IS_DOT_GIT ;
135
- if (* rel != '/' )
136
- return IS_WORKDIR_PATH ; /* e.g. .gitignore */
137
- rel ++ ;
138
-
139
- if (!fspathncmp (rel , FSMONITOR_COOKIE_PREFIX ,
140
- strlen (FSMONITOR_COOKIE_PREFIX )))
141
- return IS_INSIDE_DOT_GIT_WITH_COOKIE_PREFIX ;
142
-
143
- return IS_INSIDE_DOT_GIT ;
144
- }
145
-
146
- enum fsmonitor_path_type fsmonitor_classify_path_gitdir_relative (
147
- const char * rel )
148
- {
149
- if (!fspathncmp (rel , FSMONITOR_COOKIE_PREFIX ,
150
- strlen (FSMONITOR_COOKIE_PREFIX )))
151
- return IS_INSIDE_GITDIR_WITH_COOKIE_PREFIX ;
152
-
153
- return IS_INSIDE_GITDIR ;
154
- }
155
-
156
- static enum fsmonitor_path_type try_classify_workdir_abs_path (
157
- struct fsmonitor_daemon_state * state ,
158
- const char * path )
159
- {
160
- const char * rel ;
161
-
162
- if (fspathncmp (path , state -> path_worktree_watch .buf ,
163
- state -> path_worktree_watch .len ))
164
- return IS_OUTSIDE_CONE ;
165
-
166
- rel = path + state -> path_worktree_watch .len ;
167
-
168
- if (!* rel )
169
- return IS_WORKDIR_PATH ; /* it is the root dir exactly */
170
- if (* rel != '/' )
171
- return IS_OUTSIDE_CONE ;
172
- rel ++ ;
173
-
174
- return fsmonitor_classify_path_workdir_relative (rel );
175
- }
176
-
177
- enum fsmonitor_path_type fsmonitor_classify_path_absolute (
178
- struct fsmonitor_daemon_state * state ,
179
- const char * path )
180
- {
181
- const char * rel ;
182
- enum fsmonitor_path_type t ;
183
-
184
- t = try_classify_workdir_abs_path (state , path );
185
- if (state -> nr_paths_watching == 1 )
186
- return t ;
187
- if (t != IS_OUTSIDE_CONE )
188
- return t ;
189
-
190
- if (fspathncmp (path , state -> path_gitdir_watch .buf ,
191
- state -> path_gitdir_watch .len ))
192
- return IS_OUTSIDE_CONE ;
193
-
194
- rel = path + state -> path_gitdir_watch .len ;
195
-
196
- if (!* rel )
197
- return IS_GITDIR ; /* it is the <gitdir> exactly */
198
- if (* rel != '/' )
199
- return IS_OUTSIDE_CONE ;
200
- rel ++ ;
201
-
202
- return fsmonitor_classify_path_gitdir_relative (rel );
203
- }
204
-
205
124
static void * fsm_listen__thread_proc (void * _state )
206
125
{
207
126
struct fsmonitor_daemon_state * state = _state ;
0 commit comments