symlinks.h: move declarations for symlinks.c functions from cache.h
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Apr 22, 2023 at 20:17 UTC
cb2a51356d3019582128a818aea533ccd11f42c0
17 files changed
+44
-23
apply.c
+1
@@ -30,6 +30,7 @@
30
#include "apply.h"
31
#include "entry.h"
32
#include "setup.h"
33
+#include "symlinks.h"
34
#include "wrapper.h"
35
36
struct gitdiff_data {
builtin/checkout.c
+1
@@ -28,6 +28,7 @@
28
#include "setup.h"
29
#include "submodule.h"
30
#include "submodule-config.h"
31
+#include "symlinks.h"
32
#include "trace2.h"
33
#include "tree.h"
34
#include "tree-walk.h"
builtin/update-index.c
+1
@@ -23,6 +23,7 @@
23
#include "dir.h"
24
#include "setup.h"
25
#include "split-index.h"
26
+#include "symlinks.h"
27
#include "fsmonitor.h"
28
#include "write-or-die.h"
29
cache.h
-22
@@ -593,28 +593,6 @@ int df_name_compare(const char *name1, size_t len1, int mode1,
593
int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
594
int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
595
596
-struct cache_def {
597
- struct strbuf path;
598
- int flags;
599
- int track_flags;
600
- int prefix_len_stat_func;
601
-};
602
-#define CACHE_DEF_INIT { \
603
- .path = STRBUF_INIT, \
604
-}
605
-static inline void cache_def_clear(struct cache_def *cache)
606
-{
607
- strbuf_release(&cache->path);
608
-}
609
-
610
-int has_symlink_leading_path(const char *name, int len);
611
-int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
612
-int check_leading_path(const char *name, int len, int warn_on_lstat_err);
613
-int has_dirs_only_path(const char *name, int len, int prefix_len);
614
-void invalidate_lstat_cache(void);
615
-void schedule_dir_for_removal(const char *name, int len);
616
-void remove_scheduled_dirs(void);
617
-
596
struct pack_window {
597
struct pack_window *next;
598
unsigned char *base;
compat/mingw.c
+1
@@ -13,6 +13,7 @@
13
#include "../config.h"
14
#include "../environment.h"
15
#include "../trace2.h"
16
+#include "../symlinks.h"
17
#include "../wrapper.h"
18
#include "dir.h"
19
#include "gettext.h"
diff-lib.c
+1
@@ -14,6 +14,7 @@
14
#include "unpack-trees.h"
15
#include "refs.h"
16
#include "submodule.h"
17
+#include "symlinks.h"
18
#include "trace.h"
19
#include "dir.h"
20
#include "fsmonitor.h"
dir.c
+1
@@ -25,6 +25,7 @@
25
#include "fsmonitor.h"
26
#include "setup.h"
27
#include "submodule-config.h"
28
+#include "symlinks.h"
29
#include "trace2.h"
30
#include "wrapper.h"
31
entry.c
+1
@@ -7,6 +7,7 @@
7
#include "hex.h"
8
#include "streaming.h"
9
#include "submodule.h"
10
+#include "symlinks.h"
11
#include "progress.h"
12
#include "fsmonitor.h"
13
#include "entry.h"
merge-recursive.c
+1
@@ -30,6 +30,7 @@
30
#include "string-list.h"
31
#include "submodule-config.h"
32
#include "submodule.h"
33
+#include "symlinks.h"
34
#include "tag.h"
35
#include "tree-walk.h"
36
#include "unpack-trees.h"
parallel-checkout.c
+1
@@ -10,6 +10,7 @@
10
#include "run-command.h"
11
#include "sigchain.h"
12
#include "streaming.h"
13
+#include "symlinks.h"
14
#include "thread-utils.h"
15
#include "trace2.h"
16
#include "wrapper.h"
pathspec.c
+1
@@ -8,6 +8,7 @@
8
#include "attr.h"
9
#include "setup.h"
10
#include "strvec.h"
11
+#include "symlinks.h"
12
#include "quote.h"
13
14
/*
preload-index.c
+1
@@ -11,6 +11,7 @@
11
#include "progress.h"
12
#include "thread-utils.h"
13
#include "repository.h"
14
+#include "symlinks.h"
15
#include "trace2.h"
16
17
/*
read-cache.c
+1
@@ -30,6 +30,7 @@
30
#include "trace2.h"
31
#include "varint.h"
32
#include "split-index.h"
33
+#include "symlinks.h"
34
#include "utf8.h"
35
#include "fsmonitor.h"
36
#include "thread-utils.h"
run-command.c
+1
@@ -5,6 +5,7 @@
5
#include "gettext.h"
6
#include "sigchain.h"
7
#include "strvec.h"
8
+#include "symlinks.h"
9
#include "thread-utils.h"
10
#include "strbuf.h"
11
#include "string-list.h"
symlinks.c
+2
-1
@@ -1,6 +1,7 @@
1
-#include "cache.h"
1
+#include "git-compat-util.h"
2
#include "gettext.h"
3
#include "setup.h"
4
+#include "symlinks.h"
5
6
static int threaded_check_leading_path(struct cache_def *cache, const char *name,
7
int len, int warn_on_lstat_err);
symlinks.h
new
+28
@@ -0,0 +1,28 @@
1
+#ifndef SYMLINKS_H
2
+#define SYMLINKS_H
3
+
4
+#include "strbuf.h"
5
+
6
+struct cache_def {
7
+ struct strbuf path;
8
+ int flags;
9
+ int track_flags;
10
+ int prefix_len_stat_func;
11
+};
12
+#define CACHE_DEF_INIT { \
13
+ .path = STRBUF_INIT, \
14
+}
15
+static inline void cache_def_clear(struct cache_def *cache)
16
+{
17
+ strbuf_release(&cache->path);
18
+}
19
+
20
+int has_symlink_leading_path(const char *name, int len);
21
+int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
22
+int check_leading_path(const char *name, int len, int warn_on_lstat_err);
23
+int has_dirs_only_path(const char *name, int len, int prefix_len);
24
+void invalidate_lstat_cache(void);
25
+void schedule_dir_for_removal(const char *name, int len);
26
+void remove_scheduled_dirs(void);
27
+
28
+#endif /* SYMLINKS_H */
unpack-trees.c
+1
@@ -18,6 +18,7 @@
18
#include "sparse-index.h"
19
#include "submodule.h"
20
#include "submodule-config.h"
21
+#include "symlinks.h"
22
#include "trace2.h"
23
#include "fsmonitor.h"
24
#include "object-store.h"