Commit f7d92bc
config: refactor include_by_gitdir() into include_by_path()
The include_by_gitdir() function matches the realpath of a given
path against a glob pattern, but its interface is tightly coupled to
the gitdir condition: it takes a struct config_options *opts and
extracts opts->git_dir internally.
Refactor it into a more generic include_by_path() helper that takes
a const char *path parameter directly, and update the gitdir and
gitdir/i callers to pass opts->git_dir explicitly. No behavior
change, just preparing for the addition of a new worktree condition
that will reuse the same path-matching logic with a different path.
Signed-off-by: Chen Linxuan <me@black-desk.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 2565546 commit f7d92bc
1 file changed
+8
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
239 | | - | |
240 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | 246 | | |
248 | 247 | | |
249 | | - | |
250 | | - | |
251 | | - | |
| 248 | + | |
252 | 249 | | |
253 | 250 | | |
254 | | - | |
| 251 | + | |
255 | 252 | | |
256 | 253 | | |
257 | 254 | | |
| |||
284 | 281 | | |
285 | 282 | | |
286 | 283 | | |
287 | | - | |
| 284 | + | |
288 | 285 | | |
289 | 286 | | |
290 | 287 | | |
| |||
400 | 397 | | |
401 | 398 | | |
402 | 399 | | |
403 | | - | |
| 400 | + | |
404 | 401 | | |
405 | | - | |
| 402 | + | |
406 | 403 | | |
407 | 404 | | |
408 | 405 | | |
| |||
0 commit comments